summaryrefslogtreecommitdiff
path: root/spec/javascripts
diff options
context:
space:
mode:
authorPhil Hughes <me@iamphill.com>2017-05-04 17:31:59 +0100
committerPhil Hughes <me@iamphill.com>2017-05-04 17:31:59 +0100
commit136baeda508ddf46f6d91c03d4128b2ee890d205 (patch)
tree655907e241ffabaaedad7b511feac102403dae0d /spec/javascripts
parent9904c12746e744c4e271fe454b04a54dfb9b668e (diff)
downloadgitlab-ce-136baeda508ddf46f6d91c03d4128b2ee890d205.tar.gz
Fixed Karma specdeploy-keys-load-async
Diffstat (limited to 'spec/javascripts')
-rw-r--r--spec/javascripts/deploy_keys/components/app_spec.js15
1 files changed, 12 insertions, 3 deletions
diff --git a/spec/javascripts/deploy_keys/components/app_spec.js b/spec/javascripts/deploy_keys/components/app_spec.js
index 43b8f718508..700897f50b0 100644
--- a/spec/javascripts/deploy_keys/components/app_spec.js
+++ b/spec/javascripts/deploy_keys/components/app_spec.js
@@ -116,15 +116,24 @@ describe('Deploy keys app component', () => {
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];
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);
- expect(vm.disableKey).toHaveBeenCalledWith(key);
+ expect(vm.service.disableKey).toHaveBeenCalledWith(key.id);
});
it('hasKeys returns true when there are keys', () => {