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
3aee8089
Commit
3aee8089
authored
Jun 24, 2020
by
Miguel Rincon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove repeating dispatch and commit mocks
parent
d9a1e681
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
17 deletions
+6
-17
spec/frontend/monitoring/store/actions_spec.js
spec/frontend/monitoring/store/actions_spec.js
+6
-17
No files found.
spec/frontend/monitoring/store/actions_spec.js
View file @
3aee8089
...
...
@@ -62,11 +62,17 @@ describe('Monitoring store actions', () => {
let
store
;
let
state
;
let
dispatch
;
let
commit
;
beforeEach
(()
=>
{
store
=
createStore
({
getters
});
state
=
store
.
state
.
monitoringDashboard
;
mock
=
new
MockAdapter
(
axios
);
commit
=
jest
.
fn
();
dispatch
=
jest
.
fn
();
jest
.
spyOn
(
commonUtils
,
'
backOff
'
).
mockImplementation
(
callback
=>
{
const
q
=
new
Promise
((
resolve
,
reject
)
=>
{
const
stop
=
arg
=>
(
arg
instanceof
Error
?
reject
(
arg
)
:
resolve
(
arg
));
...
...
@@ -199,12 +205,8 @@ describe('Monitoring store actions', () => {
// Metrics dashboard
describe
(
'
fetchDashboard
'
,
()
=>
{
let
dispatch
;
let
commit
;
const
response
=
metricsDashboardResponse
;
beforeEach
(()
=>
{
dispatch
=
jest
.
fn
();
commit
=
jest
.
fn
();
state
.
dashboardEndpoint
=
'
/dashboard
'
;
});
...
...
@@ -291,14 +293,6 @@ describe('Monitoring store actions', () => {
});
describe
(
'
receiveMetricsDashboardSuccess
'
,
()
=>
{
let
commit
;
let
dispatch
;
beforeEach
(()
=>
{
commit
=
jest
.
fn
();
dispatch
=
jest
.
fn
();
});
it
(
'
stores groups
'
,
()
=>
{
const
response
=
metricsDashboardResponse
;
receiveMetricsDashboardSuccess
({
state
,
commit
,
dispatch
},
{
response
});
...
...
@@ -358,13 +352,8 @@ describe('Monitoring store actions', () => {
// Metrics
describe
(
'
fetchDashboardData
'
,
()
=>
{
let
commit
;
let
dispatch
;
beforeEach
(()
=>
{
jest
.
spyOn
(
Tracking
,
'
event
'
);
commit
=
jest
.
fn
();
dispatch
=
jest
.
fn
();
state
.
timeRange
=
defaultTimeRange
;
});
...
...
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