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
13983d24
Commit
13983d24
authored
Apr 29, 2020
by
Thomas Randolph
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Test new diffFile Viewer mutation
parent
d1d4b576
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
0 deletions
+30
-0
spec/frontend/diffs/store/mutations_spec.js
spec/frontend/diffs/store/mutations_spec.js
+30
-0
No files found.
spec/frontend/diffs/store/mutations_spec.js
View file @
13983d24
...
...
@@ -1041,6 +1041,36 @@ describe('DiffsStoreMutations', () => {
});
});
describe
(
'
SET_DIFF_FILE_VIEWER
'
,
()
=>
{
it
(
"
should update the correct diffFile's viewer property
"
,
()
=>
{
const
state
=
{
diffFiles
:
[
{
file_path
:
'
SearchString
'
,
viewer
:
'
OLD VIEWER
'
},
{
file_path
:
'
OtherSearchString
'
},
{
file_path
:
'
SomeOtherString
'
},
],
};
mutations
[
types
.
SET_DIFF_FILE_VIEWER
](
state
,
{
filePath
:
'
SearchString
'
,
viewer
:
'
NEW VIEWER
'
,
});
expect
(
state
.
diffFiles
[
0
].
viewer
).
toEqual
(
'
NEW VIEWER
'
);
expect
(
state
.
diffFiles
[
1
].
viewer
).
not
.
toBeDefined
();
expect
(
state
.
diffFiles
[
2
].
viewer
).
not
.
toBeDefined
();
mutations
[
types
.
SET_DIFF_FILE_VIEWER
](
state
,
{
filePath
:
'
OtherSearchString
'
,
viewer
:
'
NEW VIEWER
'
,
});
expect
(
state
.
diffFiles
[
0
].
viewer
).
toEqual
(
'
NEW VIEWER
'
);
expect
(
state
.
diffFiles
[
1
].
viewer
).
toEqual
(
'
NEW VIEWER
'
);
expect
(
state
.
diffFiles
[
2
].
viewer
).
not
.
toBeDefined
();
});
});
describe
(
'
SET_SHOW_SUGGEST_POPOVER
'
,
()
=>
{
it
(
'
sets showSuggestPopover to false
'
,
()
=>
{
const
state
=
{
showSuggestPopover
:
true
};
...
...
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