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
083e896d
Commit
083e896d
authored
Apr 07, 2019
by
Luke Bennett
Committed by
Luke Bennett
Apr 07, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix unmocked requests in serverless tests
parent
97b8853d
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
16 additions
and
8 deletions
+16
-8
spec/frontend/serverless/components/area_spec.js
spec/frontend/serverless/components/area_spec.js
+1
-1
spec/frontend/serverless/components/function_row_spec.js
spec/frontend/serverless/components/function_row_spec.js
+2
-1
spec/frontend/serverless/components/functions_spec.js
spec/frontend/serverless/components/functions_spec.js
+10
-5
spec/frontend/serverless/store/actions_spec.js
spec/frontend/serverless/store/actions_spec.js
+3
-1
No files found.
spec/frontend/serverless/components/area_spec.js
View file @
083e896d
...
@@ -67,7 +67,7 @@ describe('Area component', () => {
...
@@ -67,7 +67,7 @@ describe('Area component', () => {
const
mockWidth
=
233
;
const
mockWidth
=
233
;
beforeEach
(()
=>
{
beforeEach
(()
=>
{
spyOn
(
Element
.
prototype
,
'
getBoundingClientRect
'
).
and
.
callFake
(()
=>
({
jest
.
spyOn
(
Element
.
prototype
,
'
getBoundingClientRect
'
).
mockImplementation
(()
=>
({
width
:
mockWidth
,
width
:
mockWidth
,
}));
}));
areaChart
.
vm
.
onResize
();
areaChart
.
vm
.
onResize
();
...
...
spec/frontend/serverless/components/function_row_spec.js
View file @
083e896d
...
@@ -3,7 +3,8 @@ import { shallowMount } from '@vue/test-utils';
...
@@ -3,7 +3,8 @@ import { shallowMount } from '@vue/test-utils';
import
{
mockServerlessFunction
}
from
'
../mock_data
'
;
import
{
mockServerlessFunction
}
from
'
../mock_data
'
;
const
createComponent
=
func
=>
shallowMount
(
functionRowComponent
,
{
propsData
:
{
func
}
}).
vm
;
const
createComponent
=
func
=>
shallowMount
(
functionRowComponent
,
{
propsData
:
{
func
},
sync
:
false
}).
vm
;
describe
(
'
functionRowComponent
'
,
()
=>
{
describe
(
'
functionRowComponent
'
,
()
=>
{
it
(
'
Parses the function details correctly
'
,
()
=>
{
it
(
'
Parses the function details correctly
'
,
()
=>
{
...
...
spec/frontend/serverless/components/functions_spec.js
View file @
083e896d
import
Vuex
from
'
vuex
'
;
import
Vuex
from
'
vuex
'
;
import
AxiosMockAdapter
from
'
axios-mock-adapter
'
;
import
axios
from
'
~/lib/utils/axios_utils
'
;
import
functionsComponent
from
'
~/serverless/components/functions.vue
'
;
import
functionsComponent
from
'
~/serverless/components/functions.vue
'
;
import
{
createLocalVue
,
shallowMount
}
from
'
@vue/test-utils
'
;
import
{
createLocalVue
,
shallowMount
}
from
'
@vue/test-utils
'
;
import
{
createStore
}
from
'
~/serverless/store
'
;
import
{
createStore
}
from
'
~/serverless/store
'
;
...
@@ -79,15 +80,19 @@ describe('functionsComponent', () => {
...
@@ -79,15 +80,19 @@ describe('functionsComponent', () => {
);
);
});
});
it
(
'
should render the functions list
'
,
()
=>
{
fit
(
'
should render the functions list
'
,
()
=>
{
const
statusPath
=
'
statusPath
'
;
const
axiosMock
=
new
AxiosMockAdapter
(
axios
);
axiosMock
.
onGet
(
statusPath
).
reply
(
200
);
component
=
shallowMount
(
functionsComponent
,
{
component
=
shallowMount
(
functionsComponent
,
{
localVue
,
localVue
,
store
,
store
,
propsData
:
{
propsData
:
{
installed
:
true
,
installed
:
true
,
clustersPath
:
''
,
clustersPath
:
'
clustersPath
'
,
helpPath
:
''
,
helpPath
:
'
helpPath
'
,
statusPath
:
''
,
statusPath
,
},
},
sync
:
false
,
sync
:
false
,
});
});
...
...
spec/frontend/serverless/store/actions_spec.js
View file @
083e896d
...
@@ -32,7 +32,9 @@ describe('ServerlessActions', () => {
...
@@ -32,7 +32,9 @@ describe('ServerlessActions', () => {
it
(
'
should successfully retry
'
,
done
=>
{
it
(
'
should successfully retry
'
,
done
=>
{
const
endpoint
=
'
/functions
'
;
const
endpoint
=
'
/functions
'
;
const
mock
=
new
MockAdapter
(
axios
);
const
mock
=
new
MockAdapter
(
axios
);
mock
.
onGet
(
endpoint
).
reply
(
statusCodes
.
NO_CONTENT
);
mock
.
onGet
(
endpoint
)
.
reply
(()
=>
new
Promise
(
resolve
=>
setTimeout
(()
=>
resolve
(
200
),
Infinity
)));
testAction
(
testAction
(
fetchFunctions
,
fetchFunctions
,
...
...
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