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
Boxiang Sun
gitlab-ce
Commits
2b66879e
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
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
4 deletions
+22
-4
spec/javascripts/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