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
b5d50025
Commit
b5d50025
authored
Jul 18, 2019
by
Nick Kipling
Committed by
Nathan Friend
Jul 30, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updating table_registry tests
parent
71f2d4bb
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
6 deletions
+12
-6
spec/javascripts/registry/components/table_registry_spec.js
spec/javascripts/registry/components/table_registry_spec.js
+12
-6
No files found.
spec/javascripts/registry/components/table_registry_spec.js
View file @
b5d50025
...
...
@@ -8,6 +8,7 @@ const [firstImage, secondImage] = repoPropsData.list;
describe
(
'
table registry
'
,
()
=>
{
let
vm
;
let
Component
;
const
bulkDeletePath
=
'
path
'
;
const
findDeleteBtn
=
()
=>
vm
.
$el
.
querySelector
(
'
.js-delete-registry
'
);
const
findDeleteBtnRow
=
()
=>
vm
.
$el
.
querySelector
(
'
.js-delete-registry-row
'
);
...
...
@@ -101,7 +102,7 @@ describe('table registry', () => {
expect
(
findDeleteBtn
().
disabled
).
toBe
(
false
);
findDeleteBtn
().
click
();
spyOn
(
vm
,
'
deleteItem
'
).
and
.
returnValue
(
Promise
.
resolve
());
spyOn
(
vm
,
'
deleteItem
s
'
).
and
.
returnValue
(
Promise
.
resolve
());
Vue
.
nextTick
(()
=>
{
const
modal
=
document
.
querySelector
(
`#
${
vm
.
modalId
}
`
);
...
...
@@ -111,8 +112,10 @@ describe('table registry', () => {
Vue
.
nextTick
(()
=>
{
expect
(
vm
.
itemsToBeDeleted
).
toEqual
([]);
expect
(
vm
.
deleteItem
).
toHaveBeenCalledWith
(
firstImage
);
expect
(
vm
.
deleteItem
).
toHaveBeenCalledWith
(
secondImage
);
expect
(
vm
.
deleteItems
).
toHaveBeenCalledWith
({
path
:
bulkDeletePath
,
items
:
[
firstImage
.
tag
,
secondImage
.
tag
],
});
done
();
});
});
...
...
@@ -135,18 +138,21 @@ describe('table registry', () => {
});
});
it
(
'
should call deleteItem and reset itemsToBeDeleted when confirming deletion
'
,
done
=>
{
it
(
'
should call deleteItem
s
and reset itemsToBeDeleted when confirming deletion
'
,
done
=>
{
Vue
.
nextTick
(()
=>
{
expect
(
vm
.
itemsToBeDeleted
).
toEqual
([
0
]);
expect
(
findDeleteBtn
().
disabled
).
toBe
(
false
);
findDeleteBtn
().
click
();
spyOn
(
vm
,
'
deleteItem
'
).
and
.
returnValue
(
Promise
.
resolve
());
spyOn
(
vm
,
'
deleteItem
s
'
).
and
.
returnValue
(
Promise
.
resolve
());
Vue
.
nextTick
(()
=>
{
document
.
querySelector
(
`#
${
vm
.
modalId
}
.btn-danger`
).
click
();
expect
(
vm
.
itemsToBeDeleted
).
toEqual
([]);
expect
(
vm
.
deleteItem
).
toHaveBeenCalledWith
(
firstImage
);
expect
(
vm
.
deleteItems
).
toHaveBeenCalledWith
({
path
:
bulkDeletePath
,
items
:
[
firstImage
.
tag
],
});
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