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
05209977
Commit
05209977
authored
Mar 16, 2020
by
Paul Slaughter
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move changed_file_icon deleted test to parameter
parent
cfeaf97a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
11 deletions
+3
-11
spec/frontend/vue_shared/components/changed_file_icon_spec.js
.../frontend/vue_shared/components/changed_file_icon_spec.js
+3
-11
No files found.
spec/frontend/vue_shared/components/changed_file_icon_spec.js
View file @
05209977
...
...
@@ -5,6 +5,7 @@ import Icon from '~/vue_shared/components/icon.vue';
const
changedFile
=
()
=>
({
changed
:
true
});
const
stagedFile
=
()
=>
({
changed
:
true
,
staged
:
true
});
const
newFile
=
()
=>
({
changed
:
true
,
tempFile
:
true
});
const
deletedFile
=
()
=>
({
changed
:
false
,
tempFile
:
false
,
staged
:
false
,
deleted
:
true
});
const
unchangedFile
=
()
=>
({
changed
:
false
,
tempFile
:
false
,
staged
:
false
,
deleted
:
false
});
describe
(
'
Changed file icon
'
,
()
=>
{
...
...
@@ -58,9 +59,10 @@ describe('Changed file icon', () => {
${
changedFile
()}
|
${
'
file-modified
'
}
|
${
'
Modified
'
}
|
${
'
with file changed
'
}
${
stagedFile
()}
|
${
'
file-modified-solid
'
}
|
${
'
Modified
'
}
|
${
'
with file staged
'
}
${
newFile
()}
|
${
'
file-addition
'
}
|
${
'
Added
'
}
|
${
'
with file new
'
}
${
deletedFile
()}
|
${
'
file-deletion
'
}
|
${
'
Deleted
'
}
|
${
'
with file deleted
'
}
`
(
'
$desc
'
,
({
file
,
iconName
,
tooltipText
})
=>
{
beforeEach
(()
=>
{
factory
({
file
,
tooltipTitle
:
tooltipText
});
factory
({
file
});
});
it
(
'
renders icon
'
,
()
=>
{
...
...
@@ -73,16 +75,6 @@ describe('Changed file icon', () => {
});
});
it
(
'
shows "Deleted" tooltip if file has been deleted
'
,
()
=>
{
factory
({
file
:
{
deleted
:
true
,
},
});
expect
(
findTooltipText
()).
toBe
(
'
Deleted
'
);
});
describe
(
'
with file unchanged
'
,
()
=>
{
beforeEach
(()
=>
{
factory
({
...
...
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