Skip to content

Commit

Permalink
Linting & test fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
JosephVolosin committed Dec 3, 2024
1 parent ff2495b commit b22d55e
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 21 deletions.
33 changes: 18 additions & 15 deletions e2e-tests/fixtures/ExternalSources.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,27 +74,30 @@ export class ExternalSources {
await expect(this.page.getByRole('row', { name: typeName })).toBeVisible();
}
async deleteDerivationGroup(derivationGroupName: string) {
await this.page.getByRole('button', { exact: true, name: 'Derivation Group' }).click();
await this.page.getByRole('row', { name: derivationGroupName }).hover();
await this.page.getByRole('row', { name: derivationGroupName }).getByLabel('Delete Derivation Group').click();
await this.page.getByRole('button', { exact: true, name: 'Delete' }).click();
await expect(this.page.getByRole('row', { name: derivationGroupName })).not.toBeVisible();
if (await this.page.getByRole('row', { name: derivationGroupName }).isVisible()) {
await this.page.getByRole('row', { name: derivationGroupName }).hover();
await this.page.getByRole('row', { name: derivationGroupName }).getByLabel('Delete Derivation Group').click();
await this.page.getByRole('button', { exact: true, name: 'Delete' }).click();
await expect(this.page.getByRole('row', { name: derivationGroupName })).not.toBeVisible();
}
}

async deleteExternalEventType(eventTypeName: string) {
await this.page.getByRole('button', { exact: true, name: 'External Event Type' }).click();
await this.page.getByRole('row', { name: eventTypeName }).hover();
await this.page.getByRole('row', { name: eventTypeName }).getByLabel('Delete External Event Type').click();
await this.page.getByRole('button', { exact: true, name: 'Delete' }).click();
await expect(this.page.getByRole('row', { name: eventTypeName })).not.toBeVisible();
if (await this.page.getByRole('row', { name: eventTypeName }).isVisible()) {
await this.page.getByRole('row', { name: eventTypeName }).hover();
await this.page.getByRole('row', { name: eventTypeName }).getByLabel('Delete External Event Type').click();
await this.page.getByRole('button', { exact: true, name: 'Delete' }).click();
await expect(this.page.getByRole('row', { name: eventTypeName })).not.toBeVisible();
}
}

async deleteExternalSourceType(sourceTypeName: string) {
await this.page.getByRole('button', { exact: true, name: 'External Source Type' }).click();
await this.page.getByRole('row', { name: sourceTypeName }).hover();
await this.page.getByRole('row', { name: sourceTypeName }).getByLabel('Delete External Source Type').click();
await this.page.getByRole('button', { exact: true, name: 'Delete' }).click();
await expect(this.page.getByRole('row', { name: sourceTypeName })).not.toBeVisible();
if (await this.page.getByRole('row', { name: sourceTypeName }).isVisible()) {
await this.page.getByRole('row', { name: sourceTypeName }).hover();
await this.page.getByRole('row', { name: sourceTypeName }).getByLabel('Delete External Source Type').click();
await this.page.getByRole('button', { exact: true, name: 'Delete' }).click();
await expect(this.page.getByRole('row', { name: sourceTypeName })).not.toBeVisible();
}
}

async deleteSource(sourceName: string) {
Expand Down
12 changes: 6 additions & 6 deletions src/components/external-source/ExternalTypeManager.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,11 @@
import type { ParametersMap } from '../../types/parameter';
import type { ValueSchema } from '../../types/schema';
import effects from '../../utilities/effects';
import { getDerivationGroupRowId, getExternalEventTypeRowId, getExternalSourceTypeRowId } from '../../utilities/externalEvents';
import {
getDerivationGroupRowId,
getExternalEventTypeRowId,
getExternalSourceTypeRowId,
} from '../../utilities/externalEvents';
import { parseJSONStream } from '../../utilities/generic';
import { showDeleteDerivationGroupModal, showDeleteExternalEventSourceTypeModal } from '../../utilities/modal';
import { getFormParameters, translateJsonSchemaToValueSchema } from '../../utilities/parameters';
Expand Down Expand Up @@ -476,11 +480,7 @@
if (file !== undefined && /\.json$/.test(file.name)) {
uploadResponseErrors = [];
const combinedSchema = await parseJSONStream<{ event_types: object; source_types: object }>(file.stream());
await effects.createExternalSourceEventTypes(
combinedSchema.event_types,
combinedSchema.source_types,
user,
);
await effects.createExternalSourceEventTypes(combinedSchema.event_types, combinedSchema.source_types, user);
files = undefined;
file = undefined;
if (fileInput != null) {
Expand Down

0 comments on commit b22d55e

Please sign in to comment.