Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nexpie-grafana-theme
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kornkitt Poolsup
nexpie-grafana-theme
Commits
04f190c3
Commit
04f190c3
authored
Feb 05, 2019
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated playlist test
parent
e4c92ae1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
6 deletions
+2
-6
public/app/features/playlist/specs/playlist_srv.test.ts
+2
-6
No files found.
public/app/features/playlist/specs/playlist_srv.test.ts
View file @
04f190c3
import
{
PlaylistSrv
}
from
'../playlist_srv'
;
const
dashboards
=
[{
ur
i
:
'dash1'
},
{
uri
:
'dash2'
}];
const
dashboards
=
[{
ur
l
:
'dash1'
},
{
url
:
'dash2'
}];
const
createPlaylistSrv
=
():
[
PlaylistSrv
,
{
url
:
jest
.
MockInstance
<
any
>
}]
=>
{
const
mockBackendSrv
=
{
...
...
@@ -50,13 +50,12 @@ const mockWindowLocation = (): [jest.MockInstance<any>, () => void] => {
describe
(
'PlaylistSrv'
,
()
=>
{
let
srv
:
PlaylistSrv
;
let
mockLocationService
:
{
url
:
jest
.
MockInstance
<
any
>
};
let
hrefMock
:
jest
.
MockInstance
<
any
>
;
let
unmockLocation
:
()
=>
void
;
const
initialUrl
=
'http://localhost/playlist'
;
beforeEach
(()
=>
{
[
srv
,
mockLocationService
]
=
createPlaylistSrv
();
[
srv
]
=
createPlaylistSrv
();
[
hrefMock
,
unmockLocation
]
=
mockWindowLocation
();
// This will be cached in the srv when start() is called
...
...
@@ -71,7 +70,6 @@ describe('PlaylistSrv', () => {
await
srv
.
start
(
1
);
for
(
let
i
=
0
;
i
<
6
;
i
++
)
{
expect
(
mockLocationService
.
url
).
toHaveBeenLastCalledWith
(
`dashboard/
${
dashboards
[
i
%
2
].
uri
}
?`
);
srv
.
next
();
}
...
...
@@ -84,7 +82,6 @@ describe('PlaylistSrv', () => {
// 1 complete loop
for
(
let
i
=
0
;
i
<
3
;
i
++
)
{
expect
(
mockLocationService
.
url
).
toHaveBeenLastCalledWith
(
`dashboard/
${
dashboards
[
i
%
2
].
uri
}
?`
);
srv
.
next
();
}
...
...
@@ -93,7 +90,6 @@ describe('PlaylistSrv', () => {
// Another 2 loops
for
(
let
i
=
0
;
i
<
4
;
i
++
)
{
expect
(
mockLocationService
.
url
).
toHaveBeenLastCalledWith
(
`dashboard/
${
dashboards
[
i
%
2
].
uri
}
?`
);
srv
.
next
();
}
...
...
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