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
2643d3b3
Commit
2643d3b3
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
7abbbce3
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 @
2643d3b3
...
...
@@ -72,21 +72,15 @@ describe('collapsible registry container', () => {
expect
(
findDeleteBtn
()).
not
.
toBeNull
();
});
describe
(
'
clicked on delete
'
,
()
=>
{
beforeEach
(
done
=>
{
findDeleteBtn
().
click
();
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
'
,
done
=>
{
findDeleteBtn
().
click
();
spyOn
(
vm
,
'
deleteItem
'
).
and
.
returnValue
(
Promise
.
resolve
());
it
(
'
should call deleteItem when confirming deletion
'
,
()
=>
{
spyOn
(
vm
,
'
deleteItem
'
).
and
.
returnValue
(
Promise
.
resolve
());
vm
.
$el
.
querySelector
(
'
#confirm-repo-deletion-modal .btn-danger
'
).
click
();
Vue
.
nextTick
(()
=>
{
document
.
querySelector
(
'
#confirm-repo-deletion-modal .btn-danger
'
).
click
();
expect
(
vm
.
deleteItem
).
toHaveBeenCalledWith
(
vm
.
repo
);
done
();
});
});
});
...
...
spec/javascripts/registry/components/table_registry_spec.js
View file @
2643d3b3
...
...
@@ -46,23 +46,16 @@ describe('table registry', () => {
expect
(
findDeleteBtn
()).
toBeDefined
();
});
describe
(
'
clicked on delete
'
,
()
=>
{
beforeEach
(
done
=>
{
findDeleteBtn
().
click
();
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
'
,
done
=>
{
findDeleteBtn
().
click
();
spyOn
(
vm
,
'
deleteItem
'
).
and
.
returnValue
(
Promise
.
resolve
());
it
(
'
should call deleteItem and reset itemToBeDeleted when confirming deletion
'
,
()
=>
{
spyOn
(
vm
,
'
deleteItem
'
).
and
.
returnValue
(
Promise
.
resolve
());
vm
.
$el
.
querySelector
(
'
#confirm-image-deletion-modal .btn-danger
'
).
click
();
Vue
.
nextTick
(()
=>
{
document
.
querySelector
(
'
#confirm-image-deletion-modal .btn-danger
'
).
click
();
expect
(
vm
.
deleteItem
).
toHaveBeenCalledWith
(
firstImage
);
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