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
38e23eaf
Commit
38e23eaf
authored
Nov 25, 2019
by
Paul Gascou-Vaillancourt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Create factory function and destroy wrapper
parent
6ffa54ac
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
18 deletions
+22
-18
spec/frontend/diffs/components/compare_versions_spec.js
spec/frontend/diffs/components/compare_versions_spec.js
+22
-18
No files found.
spec/frontend/diffs/components/compare_versions_spec.js
View file @
38e23eaf
...
...
@@ -14,7 +14,7 @@ describe('CompareVersions', () => {
let
wrapper
;
const
targetBranch
=
{
branchName
:
'
tmp-wine-dev
'
,
versionIndex
:
-
1
};
beforeEach
(()
=>
{
const
createWrapper
=
props
=>
{
const
store
=
createStore
();
store
.
state
.
diffs
.
addedLines
=
10
;
...
...
@@ -30,8 +30,18 @@ describe('CompareVersions', () => {
mergeRequestDiffs
:
diffsMockData
,
mergeRequestDiff
:
diffsMockData
[
0
],
targetBranch
,
...
props
,
},
});
};
beforeEach
(()
=>
{
createWrapper
();
});
afterEach
(()
=>
{
wrapper
.
destroy
();
wrapper
=
null
;
});
describe
(
'
template
'
,
()
=>
{
...
...
@@ -55,15 +65,13 @@ describe('CompareVersions', () => {
});
it
(
'
should not render comparison dropdowns if no mergeRequestDiffs are specified
'
,
()
=>
{
wrapper
.
setProps
({
mergeRequestDiffs
:
[]
});
createWrapper
({
mergeRequestDiffs
:
[]
});
return
wrapper
.
vm
.
$nextTick
(()
=>
{
const
sourceDropdown
=
wrapper
.
find
(
'
.mr-version-dropdown
'
);
const
targetDropdown
=
wrapper
.
find
(
'
.mr-version-compare-dropdown
'
);
const
sourceDropdown
=
wrapper
.
find
(
'
.mr-version-dropdown
'
);
const
targetDropdown
=
wrapper
.
find
(
'
.mr-version-compare-dropdown
'
);
expect
(
sourceDropdown
.
exists
()).
toBe
(
false
);
expect
(
targetDropdown
.
exists
()).
toBe
(
false
);
});
expect
(
sourceDropdown
.
exists
()).
toBe
(
false
);
expect
(
targetDropdown
.
exists
()).
toBe
(
false
);
});
it
(
'
should render view types buttons with correct values
'
,
()
=>
{
...
...
@@ -79,23 +87,19 @@ describe('CompareVersions', () => {
});
it
(
'
adds container-limiting classes when showFileTree is false with inline diffs
'
,
()
=>
{
wrapper
.
setProps
({
isLimitedContainer
:
true
});
createWrapper
({
isLimitedContainer
:
true
});
return
wrapper
.
vm
.
$nextTick
(()
=>
{
const
limitedContainer
=
wrapper
.
find
(
'
.container-limited.limit-container-width
'
);
const
limitedContainer
=
wrapper
.
find
(
'
.container-limited.limit-container-width
'
);
expect
(
limitedContainer
.
exists
()).
toBe
(
true
);
});
expect
(
limitedContainer
.
exists
()).
toBe
(
true
);
});
it
(
'
does not add container-limiting classes when showFileTree is false with inline diffs
'
,
()
=>
{
wrapper
.
setProps
({
isLimitedContainer
:
false
});
createWrapper
({
isLimitedContainer
:
false
});
return
wrapper
.
vm
.
$nextTick
(()
=>
{
const
limitedContainer
=
wrapper
.
find
(
'
.container-limited.limit-container-width
'
);
const
limitedContainer
=
wrapper
.
find
(
'
.container-limited.limit-container-width
'
);
expect
(
limitedContainer
.
exists
()).
toBe
(
false
);
});
expect
(
limitedContainer
.
exists
()).
toBe
(
false
);
});
});
...
...
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