mirror of
https://github.com/block/buzz.git
synced 2026-10-31 06:21:34 +00:00
Expand Board context replay capture
Co-authored-by: Larry <larry@buzz.local> Signed-off-by: Logan Johnson <loganj@squareup.com>
This commit is contained in:
@@ -62,6 +62,7 @@ export function WorkstreamBoardScreen() {
|
||||
>([]);
|
||||
const [replayFocusIndex, setReplayFocusIndex] = React.useState(0);
|
||||
const startReplay = React.useCallback((references: BoardReference[]) => {
|
||||
setDiscussionMode(true);
|
||||
setReplayFocusIndex(0);
|
||||
setReplayReferences(references);
|
||||
}, []);
|
||||
|
||||
@@ -107,9 +107,20 @@ test("human and orchestrator references replay live and removed Board context",
|
||||
await expect(page.getByTestId("board-discussion")).toContainText(
|
||||
"Replay 1/2: 2 live",
|
||||
);
|
||||
await expect(page.getByTestId(`workstream-card-${CHANNEL_ID}`)).toHaveClass(
|
||||
/ring-2/,
|
||||
);
|
||||
const card = page.getByTestId(`workstream-card-${CHANNEL_ID}`);
|
||||
await expect(card).toHaveAttribute("aria-current", "true");
|
||||
await expect(card).toHaveClass(/border-dashed/);
|
||||
await expect(
|
||||
options.getByRole("button", { name: /workstream:/ }),
|
||||
).toContainText("Referenced");
|
||||
await page.getByRole("button", { name: "Next reference" }).click();
|
||||
const currentBlocker = options.getByRole("button", {
|
||||
name: /thread-blocker:/,
|
||||
});
|
||||
await expect(currentBlocker).toHaveAttribute("aria-current", "true");
|
||||
await expect(currentBlocker).toContainText("Current");
|
||||
await page.keyboard.press("ArrowLeft");
|
||||
await expect(card).toHaveAttribute("aria-current", "true");
|
||||
await page.screenshot({
|
||||
path: testInfo.outputPath("human-live-replay.png"),
|
||||
fullPage: true,
|
||||
@@ -162,13 +173,27 @@ test("human and orchestrator references replay live and removed Board context",
|
||||
await expect(page.getByTestId("board-discussion")).toContainText(
|
||||
"Replay 1/1: 0 live · 0 changed · 1 historical",
|
||||
);
|
||||
await expect(page.getByText("Historical references")).toBeVisible();
|
||||
await expect(
|
||||
page.getByText(/Removed deployment approval · formerly/),
|
||||
).toContainText("loganj-ws-board-context / Blockers");
|
||||
const historical = page.getByTestId("historical-reference-placeholder");
|
||||
await expect(historical).toBeVisible();
|
||||
await expect(historical).toContainText(
|
||||
"Historical Blockers: Removed deployment approval · Current",
|
||||
);
|
||||
await expect(historical).toHaveAttribute("aria-current", "true");
|
||||
await page.screenshot({
|
||||
path: testInfo.outputPath("orchestrator-removed-replay.png"),
|
||||
fullPage: true,
|
||||
});
|
||||
await page.waitForTimeout(2_500);
|
||||
await page.waitForTimeout(1_500);
|
||||
|
||||
// Draft text alone is unsent state. Cancelling either exit path preserves it.
|
||||
await page.keyboard.press("Escape");
|
||||
const draft = page.getByLabel("Discussion message");
|
||||
await draft.fill("Keep this unsent draft");
|
||||
page.once("dialog", async (dialog) => dialog.dismiss());
|
||||
await board.getByRole("button", { name: "Exit discussion" }).click();
|
||||
await expect(draft).toHaveValue("Keep this unsent draft");
|
||||
page.once("dialog", async (dialog) => dialog.dismiss());
|
||||
await page.keyboard.press("Escape");
|
||||
await expect(draft).toHaveValue("Keep this unsent draft");
|
||||
await page.waitForTimeout(1_500);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user