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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
5471d133
Commit
5471d133
authored
Mar 08, 2020
by
Vitaly Slobodin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Migrate ee/spec/javascripts/scim_token/ to Jest
Closes
https://gitlab.com/gitlab-org/gitlab/issues/194305
parent
2665e40c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
11 deletions
+11
-11
ee/spec/frontend/scim_token/scim_token_toggle_area_spec.js
ee/spec/frontend/scim_token/scim_token_toggle_area_spec.js
+11
-11
No files found.
ee/spec/
javascripts
/scim_token/scim_token_toggle_area_spec.js
→
ee/spec/
frontend
/scim_token/scim_token_toggle_area_spec.js
View file @
5471d133
...
...
@@ -8,22 +8,22 @@ const mockData = {
},
};
const
mockGenerateNewSCIMToken
=
jest
.
fn
(()
=>
Promise
.
resolve
(
mockData
));
jest
.
mock
(
'
ee/saml_providers/scim_token_service
'
,
()
=>
{
return
jest
.
fn
(()
=>
{
return
{
generateNewSCIMToken
:
mockGenerateNewSCIMToken
};
});
});
describe
(
'
SCIMTokenToggleArea
'
,
()
=>
{
const
FIXTURE
=
'
groups/saml_providers/show.html
'
;
let
scimTokenToggleArea
;
let
generateNewSCIMToken
;
preloadFixtures
(
FIXTURE
);
beforeEach
(()
=>
{
loadFixtures
(
FIXTURE
);
generateNewSCIMToken
=
jasmine
.
createSpy
(
'
generateNewSCIMToken
'
)
.
and
.
callFake
(()
=>
Promise
.
resolve
(
mockData
));
spyOnDependency
(
SCIMTokenToggleArea
,
'
SCIMTokenService
'
).
and
.
returnValue
({
generateNewSCIMToken
,
});
scimTokenToggleArea
=
new
SCIMTokenToggleArea
(
'
.js-generate-scim-token-container
'
,
'
.js-scim-token-container
'
,
...
...
@@ -67,15 +67,15 @@ describe('SCIMTokenToggleArea', () => {
describe
(
'
resetSCIMToken
'
,
()
=>
{
it
(
'
does not trigger token generation when the confirm is canceled
'
,
()
=>
{
spyOn
(
window
,
'
confirm
'
).
and
.
r
eturnValue
(
false
);
jest
.
spyOn
(
window
,
'
confirm
'
).
mockR
eturnValue
(
false
);
scimTokenToggleArea
.
resetSCIMToken
();
expect
(
g
enerateNewSCIMToken
).
not
.
toHaveBeenCalled
();
expect
(
mockG
enerateNewSCIMToken
).
not
.
toHaveBeenCalled
();
});
it
(
'
populates the scim form with the token data if the confirm is accepted
'
,
done
=>
{
spyOn
(
window
,
'
confirm
'
).
and
.
r
eturnValue
(
true
);
jest
.
spyOn
(
window
,
'
confirm
'
).
mockR
eturnValue
(
true
);
scimTokenToggleArea
.
resetSCIMToken
()
...
...
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