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
Tatuya Kamada
gitlab-ce
Commits
85f2dcf5
Commit
85f2dcf5
authored
Feb 02, 2017
by
Mike Greiling
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
prevent u2f tests from triggering a form submission while testing
parent
f4fca2de
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
8 deletions
+8
-8
spec/javascripts/u2f/authenticate_spec.js
spec/javascripts/u2f/authenticate_spec.js
+8
-8
No files found.
spec/javascripts/u2f/authenticate_spec.js
View file @
85f2dcf5
...
@@ -25,19 +25,20 @@
...
@@ -25,19 +25,20 @@
document
.
querySelector
(
'
#js-login-2fa-device
'
),
document
.
querySelector
(
'
#js-login-2fa-device
'
),
document
.
querySelector
(
'
.js-2fa-form
'
)
document
.
querySelector
(
'
.js-2fa-form
'
)
);
);
// bypass automatic form submission within renderAuthenticated
spyOn
(
this
.
component
,
'
renderAuthenticated
'
).
and
.
returnValue
(
true
);
return
this
.
component
.
start
();
return
this
.
component
.
start
();
});
});
it
(
'
allows authenticating via a U2F device
'
,
function
()
{
it
(
'
allows authenticating via a U2F device
'
,
function
()
{
var
authenticatedMessage
,
deviceResponse
,
inProgressMessage
;
var
inProgressMessage
;
inProgressMessage
=
this
.
container
.
find
(
"
p
"
);
inProgressMessage
=
this
.
container
.
find
(
"
p
"
);
expect
(
inProgressMessage
.
text
()).
toContain
(
"
Trying to communicate with your device
"
);
expect
(
inProgressMessage
.
text
()).
toContain
(
"
Trying to communicate with your device
"
);
this
.
u2fDevice
.
respondToAuthenticateRequest
({
this
.
u2fDevice
.
respondToAuthenticateRequest
({
deviceData
:
"
this is data from the device
"
deviceData
:
"
this is data from the device
"
});
});
authenticatedMessage
=
this
.
container
.
find
(
"
p
"
);
expect
(
this
.
component
.
renderAuthenticated
).
toHaveBeenCalledWith
(
'
{"deviceData":"this is data from the device"}
'
);
deviceResponse
=
this
.
container
.
find
(
'
#js-device-response
'
);
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
()
{
return
describe
(
"
errors
"
,
function
()
{
it
(
"
displays an error message
"
,
function
()
{
it
(
"
displays an error message
"
,
function
()
{
...
@@ -51,7 +52,7 @@
...
@@ -51,7 +52,7 @@
return
expect
(
errorMessage
.
text
()).
toContain
(
"
There was a problem communicating with your device
"
);
return
expect
(
errorMessage
.
text
()).
toContain
(
"
There was a problem communicating with your device
"
);
});
});
return
it
(
"
allows retrying authentication after an error
"
,
function
()
{
return
it
(
"
allows retrying authentication after an error
"
,
function
()
{
var
authenticatedMessage
,
retryButton
,
setupButton
;
var
retryButton
,
setupButton
;
setupButton
=
this
.
container
.
find
(
"
#js-login-u2f-device
"
);
setupButton
=
this
.
container
.
find
(
"
#js-login-u2f-device
"
);
setupButton
.
trigger
(
'
click
'
);
setupButton
.
trigger
(
'
click
'
);
this
.
u2fDevice
.
respondToAuthenticateRequest
({
this
.
u2fDevice
.
respondToAuthenticateRequest
({
...
@@ -64,8 +65,7 @@
...
@@ -64,8 +65,7 @@
this
.
u2fDevice
.
respondToAuthenticateRequest
({
this
.
u2fDevice
.
respondToAuthenticateRequest
({
deviceData
:
"
this is data from the device
"
deviceData
:
"
this is data from the device
"
});
});
authenticatedMessage
=
this
.
container
.
find
(
"
p
"
);
expect
(
this
.
component
.
renderAuthenticated
).
toHaveBeenCalledWith
(
'
{"deviceData":"this is data from the device"}
'
);
return
expect
(
authenticatedMessage
.
text
()).
toContain
(
"
We heard back from your U2F device. You have been authenticated.
"
);
});
});
});
});
});
});
...
...
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