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
822b1b3b
Commit
822b1b3b
authored
Feb 05, 2018
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed karma specs with change to axios instead of $.ajax
parent
6a7527c9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
6 deletions
+22
-6
spec/javascripts/boards/components/labels_select_spec.js
spec/javascripts/boards/components/labels_select_spec.js
+11
-3
spec/javascripts/boards/milestone_select_spec.js
spec/javascripts/boards/milestone_select_spec.js
+11
-3
No files found.
spec/javascripts/boards/components/labels_select_spec.js
View file @
822b1b3b
/* global BoardService */
import
Vue
from
'
vue
'
;
import
MockAdapter
from
'
axios-mock-adapter
'
;
import
axios
from
'
~/lib/utils/axios_utils
'
;
import
'
~/labels_select
'
;
import
LabelsSelect
from
'
~/boards/components/labels_select.vue
'
;
import
IssuableContext
from
'
~/issuable_context
'
;
...
...
@@ -32,14 +34,16 @@ const label2 = {
};
describe
(
'
LabelsSelect
'
,
()
=>
{
let
mock
;
beforeEach
((
done
)
=>
{
setFixtures
(
'
<div class="test-container"></div>
'
);
const
deferred
=
new
jQuery
.
Deferred
(
);
spyOn
(
$
,
'
ajax
'
).
and
.
returnValue
(
deferred
.
resolve
(
[
mock
=
new
MockAdapter
(
axios
);
mock
.
onGet
(
'
/some/path
'
).
reply
(
200
,
[
label
,
label2
,
])
)
;
]);
// eslint-disable-next-line no-new
new
IssuableContext
();
...
...
@@ -60,6 +64,10 @@ describe('LabelsSelect', () => {
Vue
.
nextTick
(
done
);
});
afterEach
(()
=>
{
mock
.
restore
();
});
describe
(
'
canEdit
'
,
()
=>
{
it
(
'
hides Edit button
'
,
(
done
)
=>
{
vm
.
canEdit
=
false
;
...
...
spec/javascripts/boards/milestone_select_spec.js
View file @
822b1b3b
/* global BoardService */
import
Vue
from
'
vue
'
;
import
MockAdapater
from
'
axios-mock-adapter
'
;
import
axios
from
'
~/lib/utils/axios_utils
'
;
import
MilestoneSelect
from
'
~/boards/components/milestone_select.vue
'
;
import
IssuableContext
from
'
~/issuable_context
'
;
import
{
boardObj
}
from
'
./mock_data
'
;
...
...
@@ -92,12 +94,18 @@ describe('Milestone select component', () => {
});
describe
(
'
clicking dropdown items
'
,
()
=>
{
let
mock
;
beforeEach
(()
=>
{
const
deferred
=
new
jQuery
.
Deferred
(
);
spyOn
(
$
,
'
ajax
'
).
and
.
returnValue
(
deferred
.
resolve
(
[
mock
=
new
MockAdapater
(
axios
);
mock
.
onGet
(
'
/test/issue-boards/milestones.json
'
).
reply
(
200
,
[
milestone
,
milestone2
,
]));
]);
});
afterEach
(()
=>
{
mock
.
restore
();
});
it
(
'
sets Any Milestone
'
,
(
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