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 */
/* global BoardService */
import
Vue
from
'
vue
'
;
import
Vue
from
'
vue
'
;
import
MockAdapter
from
'
axios-mock-adapter
'
;
import
axios
from
'
~/lib/utils/axios_utils
'
;
import
'
~/labels_select
'
;
import
'
~/labels_select
'
;
import
LabelsSelect
from
'
~/boards/components/labels_select.vue
'
;
import
LabelsSelect
from
'
~/boards/components/labels_select.vue
'
;
import
IssuableContext
from
'
~/issuable_context
'
;
import
IssuableContext
from
'
~/issuable_context
'
;
...
@@ -32,14 +34,16 @@ const label2 = {
...
@@ -32,14 +34,16 @@ const label2 = {
};
};
describe
(
'
LabelsSelect
'
,
()
=>
{
describe
(
'
LabelsSelect
'
,
()
=>
{
let
mock
;
beforeEach
((
done
)
=>
{
beforeEach
((
done
)
=>
{
setFixtures
(
'
<div class="test-container"></div>
'
);
setFixtures
(
'
<div class="test-container"></div>
'
);
const
deferred
=
new
jQuery
.
Deferred
(
);
mock
=
new
MockAdapter
(
axios
);
spyOn
(
$
,
'
ajax
'
).
and
.
returnValue
(
deferred
.
resolve
(
[
mock
.
onGet
(
'
/some/path
'
).
reply
(
200
,
[
label
,
label
,
label2
,
label2
,
])
)
;
]);
// eslint-disable-next-line no-new
// eslint-disable-next-line no-new
new
IssuableContext
();
new
IssuableContext
();
...
@@ -60,6 +64,10 @@ describe('LabelsSelect', () => {
...
@@ -60,6 +64,10 @@ describe('LabelsSelect', () => {
Vue
.
nextTick
(
done
);
Vue
.
nextTick
(
done
);
});
});
afterEach
(()
=>
{
mock
.
restore
();
});
describe
(
'
canEdit
'
,
()
=>
{
describe
(
'
canEdit
'
,
()
=>
{
it
(
'
hides Edit button
'
,
(
done
)
=>
{
it
(
'
hides Edit button
'
,
(
done
)
=>
{
vm
.
canEdit
=
false
;
vm
.
canEdit
=
false
;
...
...
spec/javascripts/boards/milestone_select_spec.js
View file @
822b1b3b
/* global BoardService */
/* global BoardService */
import
Vue
from
'
vue
'
;
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
MilestoneSelect
from
'
~/boards/components/milestone_select.vue
'
;
import
IssuableContext
from
'
~/issuable_context
'
;
import
IssuableContext
from
'
~/issuable_context
'
;
import
{
boardObj
}
from
'
./mock_data
'
;
import
{
boardObj
}
from
'
./mock_data
'
;
...
@@ -92,12 +94,18 @@ describe('Milestone select component', () => {
...
@@ -92,12 +94,18 @@ describe('Milestone select component', () => {
});
});
describe
(
'
clicking dropdown items
'
,
()
=>
{
describe
(
'
clicking dropdown items
'
,
()
=>
{
let
mock
;
beforeEach
(()
=>
{
beforeEach
(()
=>
{
const
deferred
=
new
jQuery
.
Deferred
(
);
mock
=
new
MockAdapater
(
axios
);
spyOn
(
$
,
'
ajax
'
).
and
.
returnValue
(
deferred
.
resolve
(
[
mock
.
onGet
(
'
/test/issue-boards/milestones.json
'
).
reply
(
200
,
[
milestone
,
milestone
,
milestone2
,
milestone2
,
]));
]);
});
afterEach
(()
=>
{
mock
.
restore
();
});
});
it
(
'
sets Any Milestone
'
,
(
done
)
=>
{
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