Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/frontend/serverless/components/functions_spec.js')
-rw-r--r--spec/frontend/serverless/components/functions_spec.js57
1 files changed, 10 insertions, 47 deletions
diff --git a/spec/frontend/serverless/components/functions_spec.js b/spec/frontend/serverless/components/functions_spec.js
index 8db04409357..0fca027fe56 100644
--- a/spec/frontend/serverless/components/functions_spec.js
+++ b/spec/frontend/serverless/components/functions_spec.js
@@ -25,55 +25,31 @@ describe('functionsComponent', () => {
localVue = createLocalVue();
localVue.use(Vuex);
- store = createStore();
+ store = createStore({});
});
afterEach(() => {
- component.vm.$destroy();
+ component.destroy();
axiosMock.restore();
});
it('should render empty state when Knative is not installed', () => {
store.dispatch('receiveFunctionsSuccess', { knative_installed: false });
- component = shallowMount(functionsComponent, {
- localVue,
- store,
- propsData: {
- clustersPath: '',
- helpPath: '',
- statusPath: '',
- },
- });
+ component = shallowMount(functionsComponent, { localVue, store });
expect(component.find(EmptyState).exists()).toBe(true);
});
it('should render a loading component', () => {
store.dispatch('requestFunctionsLoading');
- component = shallowMount(functionsComponent, {
- localVue,
- store,
- propsData: {
- clustersPath: '',
- helpPath: '',
- statusPath: '',
- },
- });
+ component = shallowMount(functionsComponent, { localVue, store });
expect(component.find(GlLoadingIcon).exists()).toBe(true);
});
it('should render empty state when there is no function data', () => {
store.dispatch('receiveFunctionsNoDataSuccess', { knative_installed: true });
- component = shallowMount(functionsComponent, {
- localVue,
- store,
- propsData: {
- clustersPath: '',
- helpPath: '',
- statusPath: '',
- },
- });
+ component = shallowMount(functionsComponent, { localVue, store });
expect(
component.vm.$el
@@ -91,30 +67,17 @@ describe('functionsComponent', () => {
...mockServerlessFunctions,
knative_installed: 'checking',
});
- component = shallowMount(functionsComponent, {
- localVue,
- store,
- propsData: {
- clustersPath: '',
- helpPath: '',
- statusPath: '',
- },
- });
+
+ component = shallowMount(functionsComponent, { localVue, store });
expect(component.find('.js-functions-wrapper').exists()).toBe(true);
expect(component.find('.js-functions-loader').exists()).toBe(true);
});
it('should render the functions list', () => {
- component = shallowMount(functionsComponent, {
- localVue,
- store,
- propsData: {
- clustersPath: 'clustersPath',
- helpPath: 'helpPath',
- statusPath,
- },
- });
+ store = createStore({ clustersPath: 'clustersPath', helpPath: 'helpPath', statusPath });
+
+ component = shallowMount(functionsComponent, { localVue, store });
component.vm.$store.dispatch('receiveFunctionsSuccess', mockServerlessFunctions);