Skip to content

Commit

Permalink
Update submitted tests based on new fixtures
Browse files Browse the repository at this point in the history
  • Loading branch information
clari182 committed Dec 6, 2024
1 parent ed15148 commit 3371b85
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions site/gatsby-site/playwright/e2e-full/apps/submitted.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ test.describe('Submitted reports', () => {

await page.locator('[data-cy="promote-button"]').click();

await expect(page.locator('[data-cy="toast"]').first()).toContainText('Successfully promoted submission to Incident 4 and Report 9');
await expect(page.locator('[data-cy="toast"]').first()).toContainText('Successfully promoted submission to Incident 5 and Report 10');

const { data: { incidents } } = await query({
query: gql`{
Expand Down Expand Up @@ -118,7 +118,7 @@ test.describe('Submitted reports', () => {

await page.locator('[data-cy="promote-to-report-button"]').click();

await expect(page.locator('[data-cy="toast"]')).toContainText('Successfully promoted submission to Incident 1 and Report 9');
await expect(page.locator('[data-cy="toast"]')).toContainText('Successfully promoted submission to Incident 1 and Report 10');

const { data: { incidents } } = await query({
query: gql`{
Expand All @@ -133,7 +133,7 @@ test.describe('Submitted reports', () => {
`,
});

expect(incidents.find((i) => i.incident_id === 1).reports.map((r) => r.report_number)).toContain(9);
expect(incidents.find((i) => i.incident_id === 1).reports.map((r) => r.report_number)).toContain(10);
});

test('Promotes a submission to a new report and links it to multiple incidents', async ({ page, login }) => {
Expand All @@ -151,8 +151,8 @@ test.describe('Submitted reports', () => {

await page.locator('[data-cy="promote-to-report-button"]').click();

await expect(page.getByText('Successfully promoted submission to Incident 2 and Report 9')).toBeVisible();
await expect(page.getByText('Successfully promoted submission to Incident 3 and Report 9')).toBeVisible();
await expect(page.getByText('Successfully promoted submission to Incident 2 and Report 10')).toBeVisible();
await expect(page.getByText('Successfully promoted submission to Incident 3 and Report 10')).toBeVisible();

const { data: { incidents } } = await query({
query: gql`{
Expand All @@ -167,8 +167,8 @@ test.describe('Submitted reports', () => {
`,
});

expect(incidents.find((i) => i.incident_id === 2).reports.map((r) => r.report_number)).toContain(9);
expect(incidents.find((i) => i.incident_id === 3).reports.map((r) => r.report_number)).toContain(9);
expect(incidents.find((i) => i.incident_id === 2).reports.map((r) => r.report_number)).toContain(10);
expect(incidents.find((i) => i.incident_id === 3).reports.map((r) => r.report_number)).toContain(10);
});

test('Promotes a submission to a new issue', async ({ page, login }) => {
Expand Down Expand Up @@ -284,6 +284,7 @@ test.describe('Submitted reports', () => {
incident_title: "Incident title",
incident_date: "2021-09-14",
editor_notes: "",
implicated_systems: ["entity-1"]
}]

await init({ aiidprod: { submissions } });
Expand Down Expand Up @@ -326,6 +327,7 @@ test.describe('Submitted reports', () => {
editor_notes: "",
description: 'Sarasa',
title: "",
implicated_systems: ["entity-1"]
}]

await init({ aiidprod: { submissions } });
Expand Down

0 comments on commit 3371b85

Please sign in to comment.