debian-mirror-gitlab/spec/frontend/google_cloud/deployments/service_table_spec.js

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

42 lines
1.4 KiB
JavaScript
Raw Normal View History

2022-03-02 08:16:31 +05:30
import { mount } from '@vue/test-utils';
import { GlButton, GlTable } from '@gitlab/ui';
2022-08-13 15:12:31 +05:30
import DeploymentsServiceTable from '~/google_cloud/deployments/service_table.vue';
2022-03-02 08:16:31 +05:30
2022-08-13 15:12:31 +05:30
describe('google_cloud/deployments/service_table', () => {
2022-03-02 08:16:31 +05:30
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 = {
2022-04-04 11:22:00 +05:30
cloudRunUrl: '#url-enable-cloud-run',
cloudStorageUrl: '#url-enable-cloud-storage',
2022-03-02 08:16:31 +05:30
};
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);
2022-04-04 11:22:00 +05:30
expect(cloudRunButton.attributes('href')).toBe('#url-enable-cloud-run');
2022-03-02 08:16:31 +05:30
});
it('should contain configure cloud storage button', () => {
const cloudStorageButton = findCloudStorageButton();
expect(cloudStorageButton.exists()).toBe(true);
expect(cloudStorageButton.props().disabled).toBe(true);
2022-04-04 11:22:00 +05:30
expect(cloudStorageButton.attributes('href')).toBe('#url-enable-cloud-storage');
2022-03-02 08:16:31 +05:30
});
});