test(ui): align rejected-submit e2e specs with per-command sync semantics
The `rename-planet` and `ship-classes` rejected-submit specs broke on the previous commit because: 1. `tests/e2e/fixtures/order-fbs.ts` builds the FBS response without `forceDefaults(true)`, and flatbuffers@25's TS codegen now elides `cmd_applied=false` against its int8 default of 0. The encoded payload no longer carried the rejection, so the UI decoded the row as `applied` and the assertions on the `rejected` status text failed first. The production Go transcoder already force-slots the field; mirror that behaviour in the e2e fixture. 2. The specs themselves still asserted the old blanket `data-sync-status="error"` on per-command rejection. After the previous commit's behaviour change the bar stays `synced` for per-command rejection (only genuine transport failures keep the red banner + Retry), so the assertions now read the row's inline reason text instead. `tests/e2e/fixtures/order-fbs.ts` also gains the `cmdErrorMessage` field so future fixtures can mirror the engine's rejection reason through the round trip. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -167,6 +167,9 @@ async function mockGateway(page: Page, opts: MockOpts): Promise<MockHandle> {
|
||||
cargo: lastCreate.cargo,
|
||||
applied,
|
||||
errorCode: applied ? null : 1,
|
||||
errorMessage: applied
|
||||
? null
|
||||
: "Entity already exists: ship type \"Drone\"",
|
||||
});
|
||||
continue;
|
||||
}
|
||||
@@ -392,9 +395,10 @@ test("rejected createShipClass keeps the table empty and surfaces the failure",
|
||||
await expect(orderTool.getByTestId("order-command-status-0")).toHaveText(
|
||||
"rejected",
|
||||
);
|
||||
await expect(orderTool.getByTestId("order-command-error-0")).toBeVisible();
|
||||
await expect(orderTool.getByTestId("order-sync")).toHaveAttribute(
|
||||
"data-sync-status",
|
||||
"error",
|
||||
"synced",
|
||||
);
|
||||
|
||||
// Switch sidebar back to inspector so the active-view (table)
|
||||
|
||||
Reference in New Issue
Block a user