Skip to content

Commit

Permalink
remove deleteDataSourceAfterTest and use toHaveAlert in config tests
Browse files Browse the repository at this point in the history
  • Loading branch information
bohandley committed Mar 12, 2024
1 parent 9412e6a commit b68ceb6
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions e2e/configuration.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ test.describe('Configuration tests', () => {
page,
}) => {
const ds = await readProvisionedDataSource<DataSourcePluginOptionsEditorProps<PromOptions>>({ fileName: 'datasources.yml' });
const configPage = await createDataSourceConfigPage({type: ds.type, deleteDataSourceAfterTest: true});
const configPage = await createDataSourceConfigPage({ type: ds.type });

// connection settings
await expect(configPage
Expand Down Expand Up @@ -82,7 +82,7 @@ test.describe('Configuration tests', () => {
readProvisionedDataSource,
}) => {
const ds = await readProvisionedDataSource<DataSourcePluginOptionsEditorProps<PromOptions>>({ fileName: 'datasources.yml' });
const configPage = await createDataSourceConfigPage({ type: ds.type, deleteDataSourceAfterTest: true, });
const configPage = await createDataSourceConfigPage({ type: ds.type });

await configPage
.getByTestIdOrAriaLabel(selectors.components.DataSource.Prometheus.configPage.connectionSettings)
Expand All @@ -96,10 +96,9 @@ test.describe('Configuration tests', () => {
readProvisionedDataSource,
}) => {
const ds = await readProvisionedDataSource<DataSourcePluginOptionsEditorProps<PromOptions>>({ fileName: 'datasources.yml' });
const configPage = await createDataSourceConfigPage({ type: ds.type, deleteDataSourceAfterTest: true, });
const configPage = await createDataSourceConfigPage({ type: ds.type });
await expect(configPage.saveAndTest()).not.toBeOK();
const alertMessage = await configPage.getByTestIdOrAriaLabel('data-testid Alert error').textContent();
await expect(alertMessage).toContain('empty url')
await expect(configPage).toHaveAlert('error', { hasText: 'empty url' });
});

test('it should allow a user to add the version when the Prom type is selected',
Expand All @@ -113,7 +112,6 @@ test.describe('Configuration tests', () => {
const configPage = await createDataSourceConfigPage({
type: "prometheus-amazon-datasource",
name: DATA_SOURCE_NAME,
deleteDataSourceAfterTest: true,
});

await expect(configPage
Expand Down Expand Up @@ -146,7 +144,6 @@ test.describe('Configuration tests', () => {
const configPage = await createDataSourceConfigPage({
type: "prometheus-amazon-datasource",
name: DATA_SOURCE_NAME + "check",
deleteDataSourceAfterTest: true,
});

const incrementalQuerying = await page
Expand Down

0 comments on commit b68ceb6

Please sign in to comment.