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
607f1b01
Commit
607f1b01
authored
Jun 09, 2020
by
Eulyeon Ko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor systemNote spec
parent
88c6e9a4
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
30 deletions
+16
-30
ee/spec/frontend/vue_shared/components/notes/system_note_spec.js
.../frontend/vue_shared/components/notes/system_note_spec.js
+16
-30
No files found.
ee/spec/frontend/vue_shared/components/notes/system_note_spec.js
View file @
607f1b01
...
...
@@ -24,6 +24,9 @@ describe('system note component', () => {
const
findDescriptionVersion
=
()
=>
wrapper
.
find
(
'
.description-version
'
);
const
findDeleteDescriptionVersionButton
=
()
=>
wrapper
.
find
({
ref
:
'
deleteDescriptionVersionButton
'
});
beforeEach
(()
=>
{
props
=
{
note
:
{
...
...
@@ -95,44 +98,27 @@ describe('system note component', () => {
});
describe
(
'
click on delete icon button
'
,
()
=>
{
beforeEach
(
done
=>
{
beforeEach
(
()
=>
{
mockFetchDiff
();
const
button
=
findBlankBtn
();
button
.
trigger
(
'
click
'
);
return
wrapper
.
vm
.
$nextTick
()
.
then
(()
=>
waitForPromises
())
.
then
(()
=>
{
done
();
});
return
waitForPromises
();
});
it
(
'
does not delete description diff if the delete request fails
'
,
done
=>
{
it
(
'
does not delete description diff if the delete request fails
'
,
()
=>
{
mockDeleteDiff
(
503
);
let
deleteButton
=
wrapper
.
find
({
ref
:
'
deleteDescriptionVersionButton
'
});
deleteButton
.
trigger
(
'
click
'
);
return
wrapper
.
vm
.
$nextTick
()
.
then
(()
=>
waitForPromises
())
.
then
(()
=>
{
deleteButton
=
wrapper
.
find
({
ref
:
'
deleteDescriptionVersionButton
'
});
expect
(
deleteButton
.
exists
()).
toBe
(
true
);
done
();
findDeleteDescriptionVersionButton
().
trigger
(
'
click
'
);
return
waitForPromises
().
then
(()
=>
{
expect
(
findDeleteDescriptionVersionButton
().
exists
()).
toBe
(
true
);
});
});
it
(
'
deletes description diff if the delete request succeeds
'
,
done
=>
{
it
(
'
deletes description diff if the delete request succeeds
'
,
()
=>
{
mockDeleteDiff
();
let
deleteButton
=
wrapper
.
find
({
ref
:
'
deleteDescriptionVersionButton
'
});
deleteButton
.
trigger
(
'
click
'
);
return
wrapper
.
vm
.
$nextTick
()
.
then
(()
=>
waitForPromises
())
.
then
(()
=>
{
deleteButton
=
wrapper
.
find
({
ref
:
'
deleteDescriptionVersionButton
'
});
expect
(
deleteButton
.
exists
()).
toBe
(
false
);
findDeleteDescriptionVersionButton
().
trigger
(
'
click
'
);
return
waitForPromises
().
then
(()
=>
{
expect
(
findDeleteDescriptionVersionButton
().
exists
()).
toBe
(
false
);
expect
(
findDescriptionVersion
().
text
()).
toContain
(
'
Deleted
'
);
done
();
});
});
});
...
...
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