mirror of
https://github.com/block/buzz.git
synced 2026-10-31 06:21:34 +00:00
test(desktop): verify blocker button activation
Use the actual contenteditable composer surface and assert the blocker button receives focus before keyboard activation. Co-authored-by: Other Brother Darryl <cee32d92756729ee0c097c5661b879c6199931cd25315c8cf398dcbf0f155cf1@buzz.block.builderlab.xyz> Signed-off-by: loganj <loganj@squareup.com> Signed-off-by: Logan Johnson <loganj@squareup.com>
This commit is contained in:
@@ -45,7 +45,7 @@ async function openBoard(page: Page) {
|
||||
await expect(page.getByTestId("workstream-board-view")).toBeVisible();
|
||||
const card = page.getByTestId(`workstream-card-${CHANNEL_ID}`);
|
||||
await expect(card).toBeVisible();
|
||||
return card.getByTestId("workstream-wait-loganj");
|
||||
return card.getByTestId("workstream-wait-loganj").locator("button");
|
||||
}
|
||||
|
||||
async function expectTargetThreadAndComposer(page: Page) {
|
||||
@@ -60,8 +60,8 @@ async function expectTargetThreadAndComposer(page: Page) {
|
||||
await expect(composer).toBeVisible();
|
||||
await expect(composer.getByTestId("message-input")).toBeVisible();
|
||||
await expect(composer.getByTestId("message-input")).toHaveAttribute(
|
||||
"data-placeholder",
|
||||
"Reply in thread to alice",
|
||||
"contenteditable",
|
||||
"true",
|
||||
);
|
||||
}
|
||||
|
||||
@@ -78,6 +78,7 @@ test("message-linked blocker opens exact target thread by keyboard", async ({
|
||||
}) => {
|
||||
const blocker = await openBoard(page);
|
||||
await blocker.focus();
|
||||
await expect(blocker).toBeFocused();
|
||||
await blocker.press("Enter");
|
||||
await expectTargetThreadAndComposer(page);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user