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
58f1442c
Commit
58f1442c
authored
Jun 28, 2019
by
Paul Gascou-Vaillancourt
Committed by
Lukas Eipert
Jun 28, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix modal related tests
parent
20f77f33
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
25 deletions
+12
-25
spec/javascripts/registry/components/collapsible_container_spec.js
...scripts/registry/components/collapsible_container_spec.js
+6
-12
spec/javascripts/registry/components/table_registry_spec.js
spec/javascripts/registry/components/table_registry_spec.js
+6
-13
No files found.
spec/javascripts/registry/components/collapsible_container_spec.js
View file @
58f1442c
...
@@ -72,21 +72,15 @@ describe('collapsible registry container', () => {
...
@@ -72,21 +72,15 @@ describe('collapsible registry container', () => {
expect
(
findDeleteBtn
()).
not
.
toBeNull
();
expect
(
findDeleteBtn
()).
not
.
toBeNull
();
});
});
describe
(
'
clicked on delete
'
,
()
=>
{
it
(
'
should call deleteItem when confirming deletion
'
,
done
=>
{
beforeEach
(
done
=>
{
findDeleteBtn
().
click
();
findDeleteBtn
().
click
();
spyOn
(
vm
,
'
deleteItem
'
).
and
.
returnValue
(
Promise
.
resolve
());
Vue
.
nextTick
(
done
);
});
it
(
'
should open confirmation modal
'
,
()
=>
{
expect
(
vm
.
$el
.
querySelector
(
'
#confirm-repo-deletion-modal
'
)).
not
.
toBeNull
();
});
it
(
'
should call deleteItem when confirming deletion
'
,
()
=>
{
Vue
.
nextTick
(()
=>
{
spyOn
(
vm
,
'
deleteItem
'
).
and
.
returnValue
(
Promise
.
resolve
());
document
.
querySelector
(
'
#confirm-repo-deletion-modal .btn-danger
'
).
click
();
vm
.
$el
.
querySelector
(
'
#confirm-repo-deletion-modal .btn-danger
'
).
click
();
expect
(
vm
.
deleteItem
).
toHaveBeenCalledWith
(
vm
.
repo
);
expect
(
vm
.
deleteItem
).
toHaveBeenCalledWith
(
vm
.
repo
);
done
();
});
});
});
});
});
});
...
...
spec/javascripts/registry/components/table_registry_spec.js
View file @
58f1442c
...
@@ -46,23 +46,16 @@ describe('table registry', () => {
...
@@ -46,23 +46,16 @@ describe('table registry', () => {
expect
(
findDeleteBtn
()).
toBeDefined
();
expect
(
findDeleteBtn
()).
toBeDefined
();
});
});
describe
(
'
clicked on delete
'
,
()
=>
{
it
(
'
should call deleteItem and reset itemToBeDeleted when confirming deletion
'
,
done
=>
{
beforeEach
(
done
=>
{
findDeleteBtn
().
click
();
findDeleteBtn
().
click
();
spyOn
(
vm
,
'
deleteItem
'
).
and
.
returnValue
(
Promise
.
resolve
());
Vue
.
nextTick
(
done
);
});
it
(
'
should open confirmation modal and set itemToBeDeleted properly
'
,
()
=>
{
expect
(
vm
.
itemToBeDeleted
).
toEqual
(
firstImage
);
expect
(
vm
.
$el
.
querySelector
(
'
#confirm-image-deletion-modal
'
)).
not
.
toBeNull
();
});
it
(
'
should call deleteItem and reset itemToBeDeleted when confirming deletion
'
,
()
=>
{
Vue
.
nextTick
(()
=>
{
spyOn
(
vm
,
'
deleteItem
'
).
and
.
returnValue
(
Promise
.
resolve
());
document
.
querySelector
(
'
#confirm-image-deletion-modal .btn-danger
'
).
click
();
vm
.
$el
.
querySelector
(
'
#confirm-image-deletion-modal .btn-danger
'
).
click
();
expect
(
vm
.
deleteItem
).
toHaveBeenCalledWith
(
firstImage
);
expect
(
vm
.
deleteItem
).
toHaveBeenCalledWith
(
firstImage
);
expect
(
vm
.
itemToBeDeleted
).
toBeNull
();
expect
(
vm
.
itemToBeDeleted
).
toBeNull
();
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