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
Hide 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', () => {
...
@@ -24,6 +24,9 @@ describe('system note component', () => {
const
findDescriptionVersion
=
()
=>
wrapper
.
find
(
'
.description-version
'
);
const
findDescriptionVersion
=
()
=>
wrapper
.
find
(
'
.description-version
'
);
const
findDeleteDescriptionVersionButton
=
()
=>
wrapper
.
find
({
ref
:
'
deleteDescriptionVersionButton
'
});
beforeEach
(()
=>
{
beforeEach
(()
=>
{
props
=
{
props
=
{
note
:
{
note
:
{
...
@@ -95,45 +98,28 @@ describe('system note component', () => {
...
@@ -95,45 +98,28 @@ describe('system note component', () => {
});
});
describe
(
'
click on delete icon button
'
,
()
=>
{
describe
(
'
click on delete icon button
'
,
()
=>
{
beforeEach
(
done
=>
{
beforeEach
(
()
=>
{
mockFetchDiff
();
mockFetchDiff
();
const
button
=
findBlankBtn
();
const
button
=
findBlankBtn
();
button
.
trigger
(
'
click
'
);
button
.
trigger
(
'
click
'
);
return
wrapper
.
vm
return
waitForPromises
();
.
$nextTick
()
.
then
(()
=>
waitForPromises
())
.
then
(()
=>
{
done
();
});
});
});
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
);
mockDeleteDiff
(
503
);
let
deleteButton
=
wrapper
.
find
({
ref
:
'
deleteDescriptionVersionButton
'
});
findDeleteDescriptionVersionButton
().
trigger
(
'
click
'
);
deleteButton
.
trigger
(
'
click
'
);
return
waitForPromises
().
then
(()
=>
{
return
wrapper
.
vm
expect
(
findDeleteDescriptionVersionButton
().
exists
()).
toBe
(
true
);
.
$nextTick
()
});
.
then
(()
=>
waitForPromises
())
.
then
(()
=>
{
deleteButton
=
wrapper
.
find
({
ref
:
'
deleteDescriptionVersionButton
'
});
expect
(
deleteButton
.
exists
()).
toBe
(
true
);
done
();
});
});
});
it
(
'
deletes description diff if the delete request succeeds
'
,
done
=>
{
it
(
'
deletes description diff if the delete request succeeds
'
,
()
=>
{
mockDeleteDiff
();
mockDeleteDiff
();
let
deleteButton
=
wrapper
.
find
({
ref
:
'
deleteDescriptionVersionButton
'
});
findDeleteDescriptionVersionButton
().
trigger
(
'
click
'
);
deleteButton
.
trigger
(
'
click
'
);
return
waitForPromises
().
then
(()
=>
{
return
wrapper
.
vm
expect
(
findDeleteDescriptionVersionButton
().
exists
()).
toBe
(
false
);
.
$nextTick
()
expect
(
findDescriptionVersion
().
text
()).
toContain
(
'
Deleted
'
);
.
then
(()
=>
waitForPromises
())
});
.
then
(()
=>
{
deleteButton
=
wrapper
.
find
({
ref
:
'
deleteDescriptionVersionButton
'
});
expect
(
deleteButton
.
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