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
0
Merge Requests
0
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
Léo-Paul Géneau
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', () => {
...
@@ -18,11 +18,11 @@ describe('ParallelDiffView', () => {
}).
$mount
();
}).
$mount
();
});
});
describe
(
'
comput
ed
'
,
()
=>
{
describe
(
'
assign
ed
'
,
()
=>
{
describe
(
'
parallelD
iffLines
'
,
()
=>
{
describe
(
'
d
iffLines
'
,
()
=>
{
it
(
'
should normalize lines for empty cells
'
,
()
=>
{
it
(
'
should normalize lines for empty cells
'
,
()
=>
{
expect
(
component
.
parallelD
iffLines
[
0
].
left
.
type
).
toEqual
(
constants
.
EMPTY_CELL_TYPE
);
expect
(
component
.
d
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
[
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', () => {
...
@@ -190,22 +190,27 @@ describe('Diffs Module Getters', () => {
beforeEach
(()
=>
{
beforeEach
(()
=>
{
line
=
{};
line
=
{};
discussionMock
.
expanded
=
true
;
line
.
left
=
{
line
.
left
=
{
lineCode
:
'
ABC
'
,
lineCode
:
'
ABC
'
,
discussions
:
[
discussionMock
],
};
};
line
.
right
=
{
line
.
right
=
{
lineCode
:
'
DEF
'
,
lineCode
:
'
DEF
'
,
discussions
:
[
discussionMock1
],
};
};
});
});
it
(
'
returns true when discussion is expanded
'
,
()
=>
{
it
(
'
returns true when discussion is expanded
'
,
()
=>
{
discussionMock
.
expanded
=
true
;
expect
(
getters
.
shouldRenderParallelCommentRow
(
localState
)(
line
)).
toEqual
(
true
);
expect
(
getters
.
shouldRenderParallelCommentRow
(
localState
)(
line
)).
toEqual
(
true
);
});
});
it
(
'
returns false when no discussion was found
'
,
()
=>
{
it
(
'
returns false when no discussion was found
'
,
()
=>
{
line
.
left
.
discussions
=
[];
line
.
right
.
discussions
=
[];
localState
.
diffLineCommentForms
.
ABC
=
false
;
localState
.
diffLineCommentForms
.
ABC
=
false
;
localState
.
diffLineCommentForms
.
DEF
=
false
;
localState
.
diffLineCommentForms
.
DEF
=
false
;
...
@@ -220,32 +225,32 @@ describe('Diffs Module Getters', () => {
...
@@ -220,32 +225,32 @@ describe('Diffs Module Getters', () => {
});
});
describe
(
'
shouldRenderInlineCommentRow
'
,
()
=>
{
describe
(
'
shouldRenderInlineCommentRow
'
,
()
=>
{
let
line
;
beforeEach
(()
=>
{
discussionMock
.
expanded
=
true
;
line
=
{
lineCode
:
'
ABC
'
,
discussions
:
[
discussionMock
],
};
});
it
(
'
returns true when diffLineCommentForms has form
'
,
()
=>
{
it
(
'
returns true when diffLineCommentForms has form
'
,
()
=>
{
localState
.
diffLineCommentForms
.
ABC
=
{};
localState
.
diffLineCommentForms
.
ABC
=
{};
expect
(
expect
(
getters
.
shouldRenderInlineCommentRow
(
localState
)(
line
)).
toEqual
(
true
);
getters
.
shouldRenderInlineCommentRow
(
localState
)({
lineCode
:
'
ABC
'
,
}),
).
toEqual
(
true
);
});
});
it
(
'
returns false when no line discussions were found
'
,
()
=>
{
it
(
'
returns false when no line discussions were found
'
,
()
=>
{
expect
(
line
.
discussions
=
[];
getters
.
shouldRenderInlineCommentRow
(
localState
,
{
expect
(
getters
.
shouldRenderInlineCommentRow
(
localState
)(
line
)).
toEqual
(
false
);
singleDiscussionByLineCode
:
()
=>
[],
})(
'
DEF
'
),
).
toEqual
(
false
);
});
});
it
(
'
returns true if all found discussions are expanded
'
,
()
=>
{
it
(
'
returns true if all found discussions are expanded
'
,
()
=>
{
discussionMock
.
expanded
=
true
;
discussionMock
.
expanded
=
true
;
expect
(
expect
(
getters
.
shouldRenderInlineCommentRow
(
localState
)(
line
)).
toEqual
(
true
);
getters
.
shouldRenderInlineCommentRow
(
localState
,
{
singleDiscussionByLineCode
:
()
=>
[
discussionMock
],
})(
'
ABC
'
),
).
toEqual
(
true
);
});
});
});
});
...
...
spec/javascripts/lazy_loader_spec.js
View file @
958cf02e
...
@@ -2,10 +2,10 @@ import LazyLoader from '~/lazy_loader';
...
@@ -2,10 +2,10 @@ import LazyLoader from '~/lazy_loader';
let
lazyLoader
=
null
;
let
lazyLoader
=
null
;
describe
(
'
LazyLoader
'
,
function
()
{
describe
(
'
LazyLoader
'
,
function
()
{
preloadFixtures
(
'
issues/issue_with_comment.html.raw
'
);
preloadFixtures
(
'
issues/issue_with_comment.html.raw
'
);
beforeEach
(
function
()
{
beforeEach
(
function
()
{
loadFixtures
(
'
issues/issue_with_comment.html.raw
'
);
loadFixtures
(
'
issues/issue_with_comment.html.raw
'
);
lazyLoader
=
new
LazyLoader
({
lazyLoader
=
new
LazyLoader
({
observerNode
:
'
body
'
,
observerNode
:
'
body
'
,
...
@@ -13,8 +13,8 @@ describe('LazyLoader', function () {
...
@@ -13,8 +13,8 @@ describe('LazyLoader', function () {
// Doing everything that happens normally in onload
// Doing everything that happens normally in onload
lazyLoader
.
loadCheck
();
lazyLoader
.
loadCheck
();
});
});
describe
(
'
behavior
'
,
function
()
{
describe
(
'
behavior
'
,
function
()
{
it
(
'
should copy value from data-src to src for img 1
'
,
function
(
done
)
{
it
(
'
should copy value from data-src to src for img 1
'
,
function
(
done
)
{
const
img
=
document
.
querySelectorAll
(
'
img[data-src]
'
)[
0
];
const
img
=
document
.
querySelectorAll
(
'
img[data-src]
'
)[
0
];
const
originalDataSrc
=
img
.
getAttribute
(
'
data-src
'
);
const
originalDataSrc
=
img
.
getAttribute
(
'
data-src
'
);
img
.
scrollIntoView
();
img
.
scrollIntoView
();
...
@@ -26,7 +26,7 @@ describe('LazyLoader', function () {
...
@@ -26,7 +26,7 @@ describe('LazyLoader', function () {
},
100
);
},
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
newImg
=
document
.
createElement
(
'
img
'
);
const
testPath
=
'
/img/testimg.png
'
;
const
testPath
=
'
/img/testimg.png
'
;
newImg
.
className
=
'
lazy
'
;
newImg
.
className
=
'
lazy
'
;
...
@@ -41,7 +41,7 @@ describe('LazyLoader', function () {
...
@@ -41,7 +41,7 @@ describe('LazyLoader', function () {
},
100
);
},
100
);
});
});
it
(
'
should not alter normal images
'
,
function
(
done
)
{
it
(
'
should not alter normal images
'
,
function
(
done
)
{
const
newImg
=
document
.
createElement
(
'
img
'
);
const
newImg
=
document
.
createElement
(
'
img
'
);
const
testPath
=
'
/img/testimg.png
'
;
const
testPath
=
'
/img/testimg.png
'
;
newImg
.
setAttribute
(
'
src
'
,
testPath
);
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