Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
958cf02e
Commit
958cf02e
authored
Sep 03, 2018
by
Tim Zallmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixes for Karma tests
parent
8563499b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
27 deletions
+32
-27
spec/javascripts/diffs/components/parallel_diff_view_spec.js
spec/javascripts/diffs/components/parallel_diff_view_spec.js
+4
-4
spec/javascripts/diffs/store/getters_spec.js
spec/javascripts/diffs/store/getters_spec.js
+22
-17
spec/javascripts/lazy_loader_spec.js
spec/javascripts/lazy_loader_spec.js
+6
-6
No files found.
spec/javascripts/diffs/components/parallel_diff_view_spec.js
View file @
958cf02e
...
...
@@ -18,11 +18,11 @@ describe('ParallelDiffView', () => {
}).
$mount
();
});
describe
(
'
comput
ed
'
,
()
=>
{
describe
(
'
parallelD
iffLines
'
,
()
=>
{
describe
(
'
assign
ed
'
,
()
=>
{
describe
(
'
d
iffLines
'
,
()
=>
{
it
(
'
should normalize lines for empty cells
'
,
()
=>
{
expect
(
component
.
parallelD
iffLines
[
0
].
left
.
type
).
toEqual
(
constants
.
EMPTY_CELL_TYPE
);
expect
(
component
.
parallelD
iffLines
[
1
].
left
.
type
).
toEqual
(
constants
.
EMPTY_CELL_TYPE
);
expect
(
component
.
d
iffLines
[
0
].
left
.
type
).
toEqual
(
constants
.
EMPTY_CELL_TYPE
);
expect
(
component
.
d
iffLines
[
1
].
left
.
type
).
toEqual
(
constants
.
EMPTY_CELL_TYPE
);
});
});
});
...
...
spec/javascripts/diffs/store/getters_spec.js
View file @
958cf02e
...
...
@@ -190,22 +190,27 @@ describe('Diffs Module Getters', () => {
beforeEach
(()
=>
{
line
=
{};
discussionMock
.
expanded
=
true
;
line
.
left
=
{
lineCode
:
'
ABC
'
,
discussions
:
[
discussionMock
],
};
line
.
right
=
{
lineCode
:
'
DEF
'
,
discussions
:
[
discussionMock1
],
};
});
it
(
'
returns true when discussion is expanded
'
,
()
=>
{
discussionMock
.
expanded
=
true
;
expect
(
getters
.
shouldRenderParallelCommentRow
(
localState
)(
line
)).
toEqual
(
true
);
});
it
(
'
returns false when no discussion was found
'
,
()
=>
{
line
.
left
.
discussions
=
[];
line
.
right
.
discussions
=
[];
localState
.
diffLineCommentForms
.
ABC
=
false
;
localState
.
diffLineCommentForms
.
DEF
=
false
;
...
...
@@ -220,32 +225,32 @@ describe('Diffs Module Getters', () => {
});
describe
(
'
shouldRenderInlineCommentRow
'
,
()
=>
{
let
line
;
beforeEach
(()
=>
{
discussionMock
.
expanded
=
true
;
line
=
{
lineCode
:
'
ABC
'
,
discussions
:
[
discussionMock
],
};
});
it
(
'
returns true when diffLineCommentForms has form
'
,
()
=>
{
localState
.
diffLineCommentForms
.
ABC
=
{};
expect
(
getters
.
shouldRenderInlineCommentRow
(
localState
)({
lineCode
:
'
ABC
'
,
}),
).
toEqual
(
true
);
expect
(
getters
.
shouldRenderInlineCommentRow
(
localState
)(
line
)).
toEqual
(
true
);
});
it
(
'
returns false when no line discussions were found
'
,
()
=>
{
expect
(
getters
.
shouldRenderInlineCommentRow
(
localState
,
{
singleDiscussionByLineCode
:
()
=>
[],
})(
'
DEF
'
),
).
toEqual
(
false
);
line
.
discussions
=
[];
expect
(
getters
.
shouldRenderInlineCommentRow
(
localState
)(
line
)).
toEqual
(
false
);
});
it
(
'
returns true if all found discussions are expanded
'
,
()
=>
{
discussionMock
.
expanded
=
true
;
expect
(
getters
.
shouldRenderInlineCommentRow
(
localState
,
{
singleDiscussionByLineCode
:
()
=>
[
discussionMock
],
})(
'
ABC
'
),
).
toEqual
(
true
);
expect
(
getters
.
shouldRenderInlineCommentRow
(
localState
)(
line
)).
toEqual
(
true
);
});
});
...
...
spec/javascripts/lazy_loader_spec.js
View file @
958cf02e
...
...
@@ -2,10 +2,10 @@ import LazyLoader from '~/lazy_loader';
let
lazyLoader
=
null
;
describe
(
'
LazyLoader
'
,
function
()
{
describe
(
'
LazyLoader
'
,
function
()
{
preloadFixtures
(
'
issues/issue_with_comment.html.raw
'
);
beforeEach
(
function
()
{
beforeEach
(
function
()
{
loadFixtures
(
'
issues/issue_with_comment.html.raw
'
);
lazyLoader
=
new
LazyLoader
({
observerNode
:
'
body
'
,
...
...
@@ -13,8 +13,8 @@ describe('LazyLoader', function () {
// Doing everything that happens normally in onload
lazyLoader
.
loadCheck
();
});
describe
(
'
behavior
'
,
function
()
{
it
(
'
should copy value from data-src to src for img 1
'
,
function
(
done
)
{
describe
(
'
behavior
'
,
function
()
{
it
(
'
should copy value from data-src to src for img 1
'
,
function
(
done
)
{
const
img
=
document
.
querySelectorAll
(
'
img[data-src]
'
)[
0
];
const
originalDataSrc
=
img
.
getAttribute
(
'
data-src
'
);
img
.
scrollIntoView
();
...
...
@@ -26,7 +26,7 @@ describe('LazyLoader', function () {
},
100
);
});
it
(
'
should lazy load dynamically added data-src images
'
,
function
(
done
)
{
it
(
'
should lazy load dynamically added data-src images
'
,
function
(
done
)
{
const
newImg
=
document
.
createElement
(
'
img
'
);
const
testPath
=
'
/img/testimg.png
'
;
newImg
.
className
=
'
lazy
'
;
...
...
@@ -41,7 +41,7 @@ describe('LazyLoader', function () {
},
100
);
});
it
(
'
should not alter normal images
'
,
function
(
done
)
{
it
(
'
should not alter normal images
'
,
function
(
done
)
{
const
newImg
=
document
.
createElement
(
'
img
'
);
const
testPath
=
'
/img/testimg.png
'
;
newImg
.
setAttribute
(
'
src
'
,
testPath
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment