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
7dcccba4
Commit
7dcccba4
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
0441a2e3
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 @
7dcccba4
...
...
@@ -67,7 +67,7 @@ describe('Area component', () => {
const
mockWidth
=
233
;
beforeEach
(()
=>
{
spyOn
(
Element
.
prototype
,
'
getBoundingClientRect
'
).
and
.
callFake
(()
=>
({
jest
.
spyOn
(
Element
.
prototype
,
'
getBoundingClientRect
'
).
mockImplementation
(()
=>
({
width
:
mockWidth
,
}));
areaChart
.
vm
.
onResize
();
...
...
spec/frontend/serverless/components/function_row_spec.js
View file @
7dcccba4
...
...
@@ -3,7 +3,8 @@ import { shallowMount } from '@vue/test-utils';
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
'
,
()
=>
{
it
(
'
Parses the function details correctly
'
,
()
=>
{
...
...
spec/frontend/serverless/components/functions_spec.js
View file @
7dcccba4
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
{
createLocalVue
,
shallowMount
}
from
'
@vue/test-utils
'
;
import
{
createStore
}
from
'
~/serverless/store
'
;
...
...
@@ -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
,
{
localVue
,
store
,
propsData
:
{
installed
:
true
,
clustersPath
:
''
,
helpPath
:
''
,
statusPath
:
''
,
clustersPath
:
'
clustersPath
'
,
helpPath
:
'
helpPath
'
,
statusPath
,
},
sync
:
false
,
});
...
...
spec/frontend/serverless/store/actions_spec.js
View file @
7dcccba4
...
...
@@ -32,7 +32,9 @@ describe('ServerlessActions', () => {
it
(
'
should successfully retry
'
,
done
=>
{
const
endpoint
=
'
/functions
'
;
const
mock
=
new
MockAdapter
(
axios
);
mock
.
onGet
(
endpoint
).
reply
(
statusCodes
.
NO_CONTENT
);
mock
.
onGet
(
endpoint
)
.
reply
(()
=>
new
Promise
(
resolve
=>
setTimeout
(()
=>
resolve
(
200
),
Infinity
)));
testAction
(
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