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
a02b930f
Commit
a02b930f
authored
Sep 16, 2019
by
Lukas Eipert
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix failing / flakey test
parent
edb1dc8e
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
9 deletions
+9
-9
ee/spec/frontend/environments_dashboard/components/__snapshots__/dashboard_spec.js.snap
...dashboard/components/__snapshots__/dashboard_spec.js.snap
+1
-0
ee/spec/frontend/prometheus_alerts/components/reset_key_spec.js
...c/frontend/prometheus_alerts/components/reset_key_spec.js
+8
-9
No files found.
ee/spec/frontend/environments_dashboard/components/__snapshots__/dashboard_spec.js.snap
View file @
a02b930f
...
...
@@ -5,6 +5,7 @@ exports[`dashboard should match the snapshot 1`] = `
class="operations-dashboard"
>
<glmodal-stub
modalclass=""
modalid="add-projects-modal"
ok-disabled="true"
ok-title="Add projects"
...
...
ee/spec/
javascripts
/prometheus_alerts/components/reset_key_spec.js
→
ee/spec/
frontend
/prometheus_alerts/components/reset_key_spec.js
View file @
a02b930f
...
...
@@ -4,6 +4,7 @@ import axios from '~/lib/utils/axios_utils';
import
ResetKey
from
'
ee/prometheus_alerts/components/reset_key.vue
'
;
import
ClipboardButton
from
'
~/vue_shared/components/clipboard_button.vue
'
;
import
{
GlModal
}
from
'
@gitlab/ui
'
;
import
waitForPromises
from
'
helpers/wait_for_promises
'
;
describe
(
'
ResetKey
'
,
()
=>
{
let
Component
;
...
...
@@ -47,23 +48,23 @@ describe('ResetKey', () => {
expect
(
vm
.
find
(
'
.js-reset-auth-key
'
).
text
()).
toEqual
(
'
Reset key
'
);
});
it
(
'
reset updates key
'
,
done
=>
{
it
(
'
reset updates key
'
,
()
=>
{
mock
.
onPost
(
propsData
.
changeKeyUrl
).
replyOnce
(
200
,
{
token
:
'
newToken
'
});
vm
.
find
(
GlModal
).
vm
.
$emit
(
'
ok
'
);
setTimeout
(()
=>
{
return
waitForPromises
().
then
(()
=>
{
expect
(
vm
.
vm
.
authorizationKey
).
toEqual
(
'
newToken
'
);
expect
(
vm
.
find
(
'
#authorization-key
'
).
attributes
(
'
value
'
)).
toEqual
(
'
newToken
'
);
done
();
});
});
it
(
'
reset key failure shows error
'
,
done
=>
{
it
(
'
reset key failure shows error
'
,
()
=>
{
mock
.
onPost
(
propsData
.
changeKeyUrl
).
replyOnce
(
500
);
vm
.
find
(
GlModal
).
vm
.
$emit
(
'
ok
'
);
setTimeout
(()
=>
{
return
waitForPromises
().
then
(()
=>
{
expect
(
vm
.
find
(
'
#authorization-key
'
).
attributes
(
'
value
'
)).
toEqual
(
propsData
.
initialAuthorizationKey
,
);
...
...
@@ -71,7 +72,6 @@ describe('ResetKey', () => {
expect
(
document
.
querySelector
(
'
.flash-container
'
).
innerText
.
trim
()).
toEqual
(
'
Failed to reset key. Please try again.
'
,
);
done
();
});
});
});
...
...
@@ -89,14 +89,13 @@ describe('ResetKey', () => {
expect
(
vm
.
find
(
'
#authorization-key
'
).
attributes
(
'
value
'
)).
toEqual
(
''
);
});
it
(
'
Generate key button triggers key change
'
,
done
=>
{
it
(
'
Generate key button triggers key change
'
,
()
=>
{
mock
.
onPost
(
propsData
.
changeKeyUrl
).
replyOnce
(
200
,
{
token
:
'
newToken
'
});
vm
.
find
(
'
.js-reset-auth-key
'
).
vm
.
$emit
(
'
click
'
);
setTimeout
(()
=>
{
return
waitForPromises
().
then
(()
=>
{
expect
(
vm
.
find
(
'
#authorization-key
'
).
attributes
(
'
value
'
)).
toEqual
(
'
newToken
'
);
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