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
4afbb99d
Commit
4afbb99d
authored
Nov 03, 2018
by
Adriel Santiago
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Resolve flaky empty state karma tests
parent
51679f61
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
6 deletions
+10
-6
ee/spec/javascripts/operations/components/dashboard/dashboard_spec.js
...scripts/operations/components/dashboard/dashboard_spec.js
+10
-6
No files found.
ee/spec/javascripts/operations/components/dashboard/dashboard_spec.js
View file @
4afbb99d
import
Vue
from
'
vue
'
;
import
MockAdapter
from
'
axios-mock-adapter
'
;
import
axios
from
'
~/lib/utils/axios_utils
'
;
import
store
from
'
ee/operations/store/index
'
;
import
{
mountComponentWithStore
}
from
'
spec/helpers/vue_mount_component_helper
'
;
import
Dashboard
from
'
ee/operations/components/dashboard/dashboard.vue
'
;
...
...
@@ -12,24 +14,28 @@ describe('dashboard component', () => {
const
ProjectSearchComponent
=
Vue
.
extend
(
ProjectSearch
);
const
DashboardProjectComponent
=
Vue
.
extend
(
DashboardProject
);
const
projectTokens
=
mockProjectData
(
1
);
const
mockListPath
=
'
mock-listPath
'
;
const
mount
=
()
=>
mountComponentWithStore
(
DashboardComponent
,
{
store
,
props
:
{
addPath
:
'
mock-addPath
'
,
listPath
:
'
mock-listPath
'
,
listPath
:
mockListPath
,
emptyDashboardSvgPath
:
'
/assets/illustrations/operations-dashboard_empty.svg
'
,
},
});
let
vm
;
let
mockAxios
;
beforeEach
(()
=>
{
vm
=
mount
();
mockAxios
=
new
MockAdapter
(
axios
);
});
afterEach
(()
=>
{
vm
.
$destroy
();
clearState
(
store
);
mockAxios
.
restore
();
});
it
(
'
renders dashboard title
'
,
()
=>
{
...
...
@@ -94,11 +100,9 @@ describe('dashboard component', () => {
});
describe
(
'
empty state
'
,
()
=>
{
beforeAll
(
done
=>
{
vm
.
$store
.
dispatch
(
'
requestProjects
'
)
.
then
(()
=>
vm
.
$nextTick
(
done
))
.
catch
(
done
.
fail
);
beforeEach
(()
=>
{
mockAxios
.
onGet
(
mockListPath
).
replyOnce
(
200
,
{
data
:
[]
});
vm
=
mount
();
});
it
(
'
renders empty state svg after requesting projects with no results
'
,
()
=>
{
...
...
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