summaryrefslogtreecommitdiff
path: root/spec/frontend/serverless/components/functions_spec.js
diff options
context:
space:
mode:
authorAchilleas Pipinellis <axil@gitlab.com>2019-06-04 12:03:48 +0000
committerAchilleas Pipinellis <axil@gitlab.com>2019-06-04 12:03:48 +0000
commit5fd70f1779fa9ea0bd5eda523833996f71d0e706 (patch)
tree27aa4cb0a5713aa7bca5eb8a5d1180d00e414089 /spec/frontend/serverless/components/functions_spec.js
parent72797b30479b8649cd4e4b42bb940093648daa9c (diff)
parentd2ea615415311e7da1daf6b0a4e5c3a23fb2f1c2 (diff)
downloadgitlab-ce-patch-66.tar.gz
Merge branch 'master' into 'patch-66'patch-66
# Conflicts: # doc/administration/high_availability/gitaly.md
Diffstat (limited to 'spec/frontend/serverless/components/functions_spec.js')
-rw-r--r--spec/frontend/serverless/components/functions_spec.js27
1 files changed, 22 insertions, 5 deletions
diff --git a/spec/frontend/serverless/components/functions_spec.js b/spec/frontend/serverless/components/functions_spec.js
index 6924fb9e91f..d8a80f8031e 100644
--- a/spec/frontend/serverless/components/functions_spec.js
+++ b/spec/frontend/serverless/components/functions_spec.js
@@ -34,11 +34,11 @@ describe('functionsComponent', () => {
});
it('should render empty state when Knative is not installed', () => {
+ store.dispatch('receiveFunctionsSuccess', { knative_installed: false });
component = shallowMount(functionsComponent, {
localVue,
store,
propsData: {
- installed: false,
clustersPath: '',
helpPath: '',
statusPath: '',
@@ -55,7 +55,6 @@ describe('functionsComponent', () => {
localVue,
store,
propsData: {
- installed: true,
clustersPath: '',
helpPath: '',
statusPath: '',
@@ -67,12 +66,11 @@ describe('functionsComponent', () => {
});
it('should render empty state when there is no function data', () => {
- store.dispatch('receiveFunctionsNoDataSuccess');
+ store.dispatch('receiveFunctionsNoDataSuccess', { knative_installed: true });
component = shallowMount(functionsComponent, {
localVue,
store,
propsData: {
- installed: true,
clustersPath: '',
helpPath: '',
statusPath: '',
@@ -91,12 +89,31 @@ describe('functionsComponent', () => {
);
});
+ it('should render functions and a loader when functions are partially fetched', () => {
+ store.dispatch('receiveFunctionsPartial', {
+ ...mockServerlessFunctions,
+ knative_installed: 'checking',
+ });
+ component = shallowMount(functionsComponent, {
+ localVue,
+ store,
+ propsData: {
+ clustersPath: '',
+ helpPath: '',
+ statusPath: '',
+ },
+ sync: false,
+ });
+
+ 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: {
- installed: true,
clustersPath: 'clustersPath',
helpPath: 'helpPath',
statusPath,