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
7515b6c9
Commit
7515b6c9
authored
Dec 29, 2020
by
jboyson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor mountComponent to mount
Part of the epic
https://gitlab.com/groups/gitlab-org/-/epics/5102
parent
4ca69686
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
18 deletions
+6
-18
spec/frontend/diffs/components/file_row_stats_spec.js
spec/frontend/diffs/components/file_row_stats_spec.js
+6
-18
No files found.
spec/frontend/diffs/components/file_row_stats_spec.js
View file @
7515b6c9
import
Vue
from
'
vue
'
;
import
{
mount
}
from
'
@vue/test-utils
'
;
import
mountComponent
from
'
helpers/vue_mount_component_helper
'
;
import
FileRowStats
from
'
~/diffs/components/file_row_stats.vue
'
;
import
FileRowStats
from
'
~/diffs/components/file_row_stats.vue
'
;
describe
(
'
Diff file row stats
'
,
()
=>
{
describe
(
'
Diff file row stats
'
,
()
=>
{
let
Component
;
const
wrapper
=
mount
(
FileRowStats
,
{
let
vm
;
propsData
:
{
beforeAll
(()
=>
{
Component
=
Vue
.
extend
(
FileRowStats
);
});
beforeEach
(()
=>
{
vm
=
mountComponent
(
Component
,
{
file
:
{
file
:
{
addedLines
:
20
,
addedLines
:
20
,
removedLines
:
10
,
removedLines
:
10
,
},
},
});
},
});
afterEach
(()
=>
{
vm
.
$destroy
();
});
});
it
(
'
renders added lines count
'
,
()
=>
{
it
(
'
renders added lines count
'
,
()
=>
{
expect
(
vm
.
$el
.
querySelector
(
'
.cgreen
'
).
textContent
).
toContain
(
'
+20
'
);
expect
(
wrapper
.
find
(
'
.cgreen
'
).
text
()
).
toContain
(
'
+20
'
);
});
});
it
(
'
renders removed lines count
'
,
()
=>
{
it
(
'
renders removed lines count
'
,
()
=>
{
expect
(
vm
.
$el
.
querySelector
(
'
.cred
'
).
textContent
).
toContain
(
'
-10
'
);
expect
(
wrapper
.
find
(
'
.cred
'
).
text
()
).
toContain
(
'
-10
'
);
});
});
});
});
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