diff options
author | Fatih Acet <acetfatih@gmail.com> | 2016-12-30 18:48:21 +0000 |
---|---|---|
committer | Fatih Acet <acetfatih@gmail.com> | 2016-12-30 18:48:21 +0000 |
commit | 44fddd29e1f210a0a8664673e8a8a142fb68929e (patch) | |
tree | 96299b3d7bf44e148e96462c350caded74c06df3 /spec/javascripts | |
parent | 9b556bf91d450c18141b4382d7910076d46e3f36 (diff) | |
parent | b285abeccc3c466b8501d1333f7391be5d6f4334 (diff) | |
download | gitlab-ce-44fddd29e1f210a0a8664673e8a8a142fb68929e.tar.gz |
Merge branch '18556-polish-up-the-u2f-flow' into 'master'
26172-stages-icons-on-pipelines-page-skewed
Improved the u2f flow
Closes #18556
See merge request !8304
Diffstat (limited to 'spec/javascripts')
-rw-r--r-- | spec/javascripts/u2f/authenticate_spec.js | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/spec/javascripts/u2f/authenticate_spec.js b/spec/javascripts/u2f/authenticate_spec.js index a8874ab12d3..064d18519ea 100644 --- a/spec/javascripts/u2f/authenticate_spec.js +++ b/spec/javascripts/u2f/authenticate_spec.js @@ -14,18 +14,19 @@ beforeEach(function() { this.u2fDevice = new MockU2FDevice; this.container = $("#js-authenticate-u2f"); - this.component = new U2FAuthenticate(this.container, { - sign_requests: [] - }, "token"); + this.component = new window.gl.U2FAuthenticate( + this.container, + '#js-login-u2f-form', + { + sign_requests: [] + }, + document.querySelector('#js-login-2fa-device'), + document.querySelector('.js-2fa-form') + ); return this.component.start(); }); it('allows authenticating via a U2F device', function() { - var authenticatedMessage, deviceResponse, inProgressMessage, setupButton, setupMessage; - setupButton = this.container.find("#js-login-u2f-device"); - setupMessage = this.container.find("p"); - expect(setupMessage.text()).toContain('Insert your security key'); - expect(setupButton.text()).toBe('Sign in via U2F device'); - setupButton.trigger('click'); + var authenticatedMessage, deviceResponse, inProgressMessage; inProgressMessage = this.container.find("p"); expect(inProgressMessage.text()).toContain("Trying to communicate with your device"); this.u2fDevice.respondToAuthenticateRequest({ @@ -33,7 +34,7 @@ }); authenticatedMessage = this.container.find("p"); deviceResponse = this.container.find('#js-device-response'); - expect(authenticatedMessage.text()).toContain("Click this button to authenticate with the GitLab server"); + expect(authenticatedMessage.text()).toContain('We heard back from your U2F device. You have been authenticated.'); return expect(deviceResponse.val()).toBe('{"deviceData":"this is data from the device"}'); }); return describe("errors", function() { @@ -62,7 +63,7 @@ deviceData: "this is data from the device" }); authenticatedMessage = this.container.find("p"); - return expect(authenticatedMessage.text()).toContain("Click this button to authenticate with the GitLab server"); + return expect(authenticatedMessage.text()).toContain("We heard back from your U2F device. You have been authenticated."); }); }); }); |