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
0
Merge Requests
0
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
Jérome Perrin
gitlab-ce
Commits
136baeda
Commit
136baeda
authored
May 04, 2017
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed Karma spec
parent
9904c127
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
4 deletions
+13
-4
app/assets/javascripts/deploy_keys/components/app.vue
app/assets/javascripts/deploy_keys/components/app.vue
+1
-1
spec/javascripts/deploy_keys/components/app_spec.js
spec/javascripts/deploy_keys/components/app_spec.js
+12
-3
No files found.
app/assets/javascripts/deploy_keys/components/app.vue
View file @
136baeda
...
@@ -66,7 +66,7 @@
...
@@ -66,7 +66,7 @@
},
},
beforeDestroy
()
{
beforeDestroy
()
{
eventHub
.
$off
(
'
enable.key
'
,
this
.
enableKey
);
eventHub
.
$off
(
'
enable.key
'
,
this
.
enableKey
);
eventHub
.
$off
(
'
remove.key
'
,
this
.
remov
eKey
);
eventHub
.
$off
(
'
remove.key
'
,
this
.
disabl
eKey
);
eventHub
.
$off
(
'
disable.key
'
,
this
.
disableKey
);
eventHub
.
$off
(
'
disable.key
'
,
this
.
disableKey
);
},
},
};
};
...
...
spec/javascripts/deploy_keys/components/app_spec.js
View file @
136baeda
...
@@ -116,15 +116,24 @@ describe('Deploy keys app component', () => {
...
@@ -116,15 +116,24 @@ describe('Deploy keys app component', () => {
expect
(
vm
.
service
.
disableKey
).
toHaveBeenCalledWith
(
key
.
id
);
expect
(
vm
.
service
.
disableKey
).
toHaveBeenCalledWith
(
key
.
id
);
});
});
it
(
'
calls disableKey when removing a key
'
,
()
=>
{
it
(
'
calls disableKey when removing a key
'
,
(
done
)
=>
{
const
key
=
data
.
public_keys
[
0
];
const
key
=
data
.
public_keys
[
0
];
spyOn
(
window
,
'
confirm
'
).
and
.
returnValue
(
true
);
spyOn
(
window
,
'
confirm
'
).
and
.
returnValue
(
true
);
spyOn
(
vm
,
'
disableKey
'
);
spyOn
(
vm
.
service
,
'
getKeys
'
);
spyOn
(
vm
.
service
,
'
disableKey
'
).
and
.
callFake
(()
=>
new
Promise
((
resolve
)
=>
{
resolve
();
setTimeout
(()
=>
{
expect
(
vm
.
service
.
getKeys
).
toHaveBeenCalled
();
done
();
});
}));
eventHub
.
$emit
(
'
remove.key
'
,
key
);
eventHub
.
$emit
(
'
remove.key
'
,
key
);
expect
(
vm
.
disableKey
).
toHaveBeenCalledWith
(
key
);
expect
(
vm
.
service
.
disableKey
).
toHaveBeenCalledWith
(
key
.
id
);
});
});
it
(
'
hasKeys returns true when there are keys
'
,
()
=>
{
it
(
'
hasKeys returns true when there are keys
'
,
()
=>
{
...
...
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