BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
2b66879e
Unverified
Commit
2b66879e
authored
Jan 29, 2018
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed issuable_spec.js
parent
0c2c8773
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
4 deletions
+22
-4
issuable_spec.js
spec/javascripts/issuable_spec.js
+22
-4
No files found.
spec/javascripts/issuable_spec.js
View file @
2b66879e
import
MockAdaptor
from
'axios-mock-adapter'
;
import
axios
from
'~/lib/utils/axios_utils'
;
import
IssuableIndex
from
'~/issuable_index'
;
describe
(
'Issuable'
,
()
=>
{
...
...
@@ -19,6 +21,8 @@ describe('Issuable', () => {
});
describe
(
'resetIncomingEmailToken'
,
()
=>
{
let
mock
;
beforeEach
(()
=>
{
const
element
=
document
.
createElement
(
'a'
);
element
.
classList
.
add
(
'incoming-email-token-reset'
);
...
...
@@ -30,14 +34,28 @@ describe('Issuable', () => {
document
.
body
.
appendChild
(
input
);
Issuable
=
new
IssuableIndex
(
'issue_'
);
mock
=
new
MockAdaptor
(
axios
);
mock
.
onPut
(
'foo'
).
reply
(
200
,
{
new_address
:
'testing123'
,
});
});
it
(
'should send request to reset email token'
,
()
=>
{
spyOn
(
jQuery
,
'ajax'
).
and
.
callThrough
();
afterEach
(()
=>
{
mock
.
restore
();
});
it
(
'should send request to reset email token'
,
(
done
)
=>
{
spyOn
(
axios
,
'put'
).
and
.
callThrough
();
document
.
querySelector
(
'.incoming-email-token-reset'
).
click
();
expect
(
jQuery
.
ajax
).
toHaveBeenCalled
();
expect
(
jQuery
.
ajax
.
calls
.
argsFor
(
0
)[
0
].
url
).
toEqual
(
'foo'
);
setTimeout
(()
=>
{
expect
(
axios
.
put
).
toHaveBeenCalledWith
(
'foo'
);
expect
(
$
(
'#issuable_email'
).
val
()).
toBe
(
'testing123'
);
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