diff options
Diffstat (limited to 'spec/frontend/google_cloud')
3 files changed, 45 insertions, 1 deletions
diff --git a/spec/frontend/google_cloud/components/app_spec.js b/spec/frontend/google_cloud/components/app_spec.js index 570ac1e6ed1..92bc7596f7d 100644 --- a/spec/frontend/google_cloud/components/app_spec.js +++ b/spec/frontend/google_cloud/components/app_spec.js @@ -24,6 +24,8 @@ const HOME_PROPS = { serviceAccounts: [{}, {}], createServiceAccountUrl: '#url-create-service-account', emptyIllustrationUrl: '#url-empty-illustration', + deploymentsCloudRunUrl: '#url-deployments-cloud-run', + deploymentsCloudStorageUrl: '#deploymentsCloudStorageUrl', }; describe('google_cloud App component', () => { diff --git a/spec/frontend/google_cloud/components/deployments_service_table_spec.js b/spec/frontend/google_cloud/components/deployments_service_table_spec.js new file mode 100644 index 00000000000..76c3bfd00a8 --- /dev/null +++ b/spec/frontend/google_cloud/components/deployments_service_table_spec.js @@ -0,0 +1,40 @@ +import { mount } from '@vue/test-utils'; +import { GlButton, GlTable } from '@gitlab/ui'; +import DeploymentsServiceTable from '~/google_cloud/components/deployments_service_table.vue'; + +describe('google_cloud DeploymentsServiceTable component', () => { + let wrapper; + + const findTable = () => wrapper.findComponent(GlTable); + const findButtons = () => findTable().findAllComponents(GlButton); + const findCloudRunButton = () => findButtons().at(0); + const findCloudStorageButton = () => findButtons().at(1); + + beforeEach(() => { + const propsData = { + cloudRunUrl: '#url-deployments-cloud-run', + cloudStorageUrl: '#url-deployments-cloud-storage', + }; + wrapper = mount(DeploymentsServiceTable, { propsData }); + }); + + afterEach(() => { + wrapper.destroy(); + }); + + it('should contain a table', () => { + expect(findTable().exists()).toBe(true); + }); + + it('should contain configure cloud run button', () => { + const cloudRunButton = findCloudRunButton(); + expect(cloudRunButton.exists()).toBe(true); + expect(cloudRunButton.props().disabled).toBe(true); + }); + + it('should contain configure cloud storage button', () => { + const cloudStorageButton = findCloudStorageButton(); + expect(cloudStorageButton.exists()).toBe(true); + expect(cloudStorageButton.props().disabled).toBe(true); + }); +}); diff --git a/spec/frontend/google_cloud/components/home_spec.js b/spec/frontend/google_cloud/components/home_spec.js index 9b4c3a79f11..3a009fc88ce 100644 --- a/spec/frontend/google_cloud/components/home_spec.js +++ b/spec/frontend/google_cloud/components/home_spec.js @@ -20,6 +20,8 @@ describe('google_cloud Home component', () => { serviceAccounts: [{}, {}], createServiceAccountUrl: '#url-create-service-account', emptyIllustrationUrl: '#url-empty-illustration', + deploymentsCloudRunUrl: '#url-deployments-cloud-run', + deploymentsCloudStorageUrl: '#deploymentsCloudStorageUrl', }; beforeEach(() => { @@ -42,7 +44,7 @@ describe('google_cloud Home component', () => { it('should contain three tab items', () => { expect(findTabItemsModel()).toEqual([ { title: 'Configuration', disabled: undefined }, - { title: 'Deployments', disabled: '' }, + { title: 'Deployments', disabled: undefined }, { title: 'Services', disabled: '' }, ]); }); |