From 83c2eaa1d49797097df86fd2d70ab278eb632381 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dafydd=20Ll=C5=B7r=20Pearson?= Date: Wed, 10 Jul 2024 12:15:02 +0100 Subject: [PATCH] test(e2e): Ensure section statuses are accurate --- e2e/tests/ui-driven/src/globalHelpers.ts | 1 + e2e/tests/ui-driven/src/sections.spec.ts | 1 + editor.planx.uk/src/pages/FlowEditor/lib/store/preview.ts | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/e2e/tests/ui-driven/src/globalHelpers.ts b/e2e/tests/ui-driven/src/globalHelpers.ts index 56331da06b..bc3d2c391a 100644 --- a/e2e/tests/ui-driven/src/globalHelpers.ts +++ b/e2e/tests/ui-driven/src/globalHelpers.ts @@ -232,6 +232,7 @@ export async function expectSections({ const pageSections = page.locator("dl dt"); const pageStatuses = page.locator("dl dd"); await expect(pageSections).toContainText(sections.map((s) => s.title)); + // TODO: This is failing await expect(pageStatuses).toContainText(sections.map((s) => s.status)); } diff --git a/e2e/tests/ui-driven/src/sections.spec.ts b/e2e/tests/ui-driven/src/sections.spec.ts index 2a44985e8a..2832a22681 100644 --- a/e2e/tests/ui-driven/src/sections.spec.ts +++ b/e2e/tests/ui-driven/src/sections.spec.ts @@ -310,6 +310,7 @@ test.describe("Section statuses", () => { }); }); + // TODO: Fix me! test.describe("simple save and return", () => { test("not started, ready to start and complete statuses", async ({ page, diff --git a/editor.planx.uk/src/pages/FlowEditor/lib/store/preview.ts b/editor.planx.uk/src/pages/FlowEditor/lib/store/preview.ts index f819ccab46..2020e9d3f3 100644 --- a/editor.planx.uk/src/pages/FlowEditor/lib/store/preview.ts +++ b/editor.planx.uk/src/pages/FlowEditor/lib/store/preview.ts @@ -369,8 +369,8 @@ export const previewStore: StateCreator< }); } } - updateSectionData(); setCurrentCard(); + updateSectionData(); }, resultData(flagSet, overrides) {