From 70a4fbec3a3ea392b60dacb7645ccecb399724e5 Mon Sep 17 00:00:00 2001 From: Mollo-i <76565859+Greenker@users.noreply.github.com> Date: Fri, 4 Dec 2026 16:58:45 +0800 Subject: [PATCH] test(editor): cover the Rearrange code row in the Actions on Save layout test (#7992) #7934 added Rearrange code to Settings > Actions on Save, so the table has five rows, but actionsOnSaveLayout.spec.ts still expected four and failed on main. The test now expects the new row, includes it in the alignment checks and asserts its trigger cell stays empty while the action is off. Co-authored-by: Greenker <76565859+Greenker@users.noreply.github.com> --- e2e/actionsOnSaveLayout.spec.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/e2e/actionsOnSaveLayout.spec.ts b/e2e/actionsOnSaveLayout.spec.ts index 5d2837a05b..2941629865 100644 --- a/e2e/actionsOnSaveLayout.spec.ts +++ b/e2e/actionsOnSaveLayout.spec.ts @@ -20,13 +20,15 @@ test("Actions on Save aligns each enabled action with its trigger in wide and na const heading = table.getByRole("columnheader", { name: "Activated on", exact: true }); const format = table.getByRole("row", { name: /Reformat code/ }); const imports = table.getByRole("row", { name: /Optimize imports/ }); + const rearrange = table.getByRole("row", { name: /Rearrange code/ }); const cleanup = table.getByRole("row", { name: /Run code cleanup/ }); const trigger = (action: typeof format) => action.getByRole("cell").nth(1); - await expect(table.getByRole("row")).toHaveCount(4); + await expect(table.getByRole("row")).toHaveCount(5); await format.getByRole("checkbox").check(); await imports.getByRole("checkbox").press("Space"); await expect(trigger(format)).toHaveText("Save or Save All"); await expect(trigger(imports)).toHaveText("Save or Save All"); + await expect(trigger(rearrange)).toBeEmpty(); await expect(trigger(cleanup)).toBeEmpty(); for (const width of [1120, 520]) { @@ -42,7 +44,7 @@ test("Actions on Save aligns each enabled action with its trigger in wide and na return range.getClientRects().length; }), ).toBe(1); - for (const row of [format, imports, cleanup]) { + for (const row of [format, imports, rearrange, cleanup]) { const cell = (await trigger(row).boundingBox())!; expect(Math.abs(column.x - cell.x)).toBeLessThan(1); expect(Math.abs(column.width - cell.width)).toBeLessThan(1);