Skip to content

Commit

Permalink
Add e2e test for only deleting invalid data while solving multiple in…
Browse files Browse the repository at this point in the history
…valid field data warnings
  • Loading branch information
tkleinke committed Nov 10, 2023
1 parent 058fa6b commit fd8849a
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions desktop/test/e2e/warnings/warnings.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { WarningsModalPage } from './warnings-modal.page';
import { AddFieldModalPage } from '../configuration/add-field-modal.page';
import { DeleteFieldDataModalPage } from './delete-field-data-modal.page';
import { ManageValuelistsModalPage } from '../configuration/manage-valuelists-modal.page';
import { FieldsViewPage } from '../widgets/fields-view.page';

const { test, expect } = require('@playwright/test');

Expand Down Expand Up @@ -273,6 +274,38 @@ test.describe('warnings --', () => {
});


test('only delete invalid data while solving multiple invalid field data warnings', async () => {

await waitForNotExist(await NavbarPage.getWarnings());
await createInvalidFieldDataWarnings(['1'], 'field');

await ResourcesPage.performCreateResource('2', 'place', 'test:field', '10');
expect(await NavbarPage.getNumberOfWarnings()).toBe('1');

await NavbarPage.clickWarningsButton();
await WarningsModalPage.clickDeleteFieldDataButton(0);
await DeleteFieldDataModalPage.clickDeleteAllSwitch();
await DeleteFieldDataModalPage.typeInConfirmFieldName('test:field');
await DeleteFieldDataModalPage.clickConfirmButton();

await waitForNotExist(await WarningsModalPage.getModalBody());
await waitForNotExist(await NavbarPage.getWarnings());

// Check that invalid field data has been deleted
await ResourcesPage.clickSelectResource('1', 'info');
let fields = await FieldsViewPage.getFields(0);
expect(await fields.count()).toBe(1);
expect(await FieldsViewPage.getFieldName(0, 0)).toEqual('Kategorie');

// Check that valid field data has not been deleted
await ResourcesPage.clickSelectResource('2', 'info');
fields = await FieldsViewPage.getFields(0);
expect(await fields.count()).toBe(2);
expect(await FieldsViewPage.getFieldName(0, 1)).toEqual('test:field');
expect(await FieldsViewPage.getFieldValue(0, 1)).toEqual('10');
});


test('solve warning for outlier values via resources view', async () => {

await waitForNotExist(await NavbarPage.getWarnings());
Expand Down

0 comments on commit fd8849a

Please sign in to comment.