2022-08-13 15:12:31 +05:30
|
|
|
import { shallowMountExtended } from 'helpers/vue_test_utils_helper';
|
|
|
|
import Panel from '~/google_cloud/databases/panel.vue';
|
|
|
|
import IncubationBanner from '~/google_cloud/components/incubation_banner.vue';
|
|
|
|
import GoogleCloudMenu from '~/google_cloud/components/google_cloud_menu.vue';
|
2022-10-11 01:57:18 +05:30
|
|
|
import ServiceTable from '~/google_cloud/databases/service_table.vue';
|
|
|
|
import InstanceTable from '~/google_cloud/databases/cloudsql/instance_table.vue';
|
2022-08-13 15:12:31 +05:30
|
|
|
|
|
|
|
describe('google_cloud/databases/panel', () => {
|
|
|
|
let wrapper;
|
|
|
|
|
|
|
|
const props = {
|
|
|
|
configurationUrl: 'configuration-url',
|
|
|
|
deploymentsUrl: 'deployments-url',
|
|
|
|
databasesUrl: 'databases-url',
|
2022-10-11 01:57:18 +05:30
|
|
|
cloudsqlPostgresUrl: 'cloudsql-postgres-url',
|
|
|
|
cloudsqlMysqlUrl: 'cloudsql-mysql-url',
|
|
|
|
cloudsqlSqlserverUrl: 'cloudsql-sqlserver-url',
|
|
|
|
cloudsqlInstances: [],
|
|
|
|
emptyIllustrationUrl: 'empty-illustration-url',
|
2022-08-13 15:12:31 +05:30
|
|
|
};
|
|
|
|
|
|
|
|
beforeEach(() => {
|
|
|
|
wrapper = shallowMountExtended(Panel, { propsData: props });
|
|
|
|
});
|
|
|
|
|
|
|
|
afterEach(() => {
|
|
|
|
wrapper.destroy();
|
|
|
|
});
|
|
|
|
|
|
|
|
it('contains incubation banner', () => {
|
|
|
|
const target = wrapper.findComponent(IncubationBanner);
|
|
|
|
expect(target.exists()).toBe(true);
|
|
|
|
});
|
|
|
|
|
|
|
|
it('contains google cloud menu with `databases` active', () => {
|
|
|
|
const target = wrapper.findComponent(GoogleCloudMenu);
|
|
|
|
expect(target.exists()).toBe(true);
|
|
|
|
expect(target.props('active')).toBe('databases');
|
|
|
|
expect(target.props('configurationUrl')).toBe(props.configurationUrl);
|
|
|
|
expect(target.props('deploymentsUrl')).toBe(props.deploymentsUrl);
|
|
|
|
expect(target.props('databasesUrl')).toBe(props.databasesUrl);
|
|
|
|
});
|
2022-10-11 01:57:18 +05:30
|
|
|
|
|
|
|
it('contains Databases service table', () => {
|
|
|
|
const target = wrapper.findComponent(ServiceTable);
|
|
|
|
expect(target.exists()).toBe(true);
|
|
|
|
});
|
|
|
|
|
|
|
|
it('contains CloudSQL instance table', () => {
|
|
|
|
const target = wrapper.findComponent(InstanceTable);
|
|
|
|
expect(target.exists()).toBe(true);
|
|
|
|
});
|
2022-08-13 15:12:31 +05:30
|
|
|
});
|