mirror of
https://github.com/block/buzz.git
synced 2026-10-29 21:41:33 +00:00
test(desktop): assert the Commands status row in the drawer's reading variant
`observer-feed-screenshots` 09 asserted the `available_commands_update`
lifecycle row as `getByText("Commands", { exact: true })`. That located the
dense variant's separate title span. The observer feed ("View activity") is
hosted by the agent activity cover drawer, so once the pin commit made the
drawer render the `conversation` variant, a plain lifecycle status recedes to a
`ConversationDivider` whose label is the joined `title · text` — and the exact
text node stopped existing.
The row is NOT dropped: the failure screenshot shows "Commands · Commands
available: 3" rendered as the centered divider. So this is a stale assertion
against the new presentation, not lost content, and the pin is correctly scoped
— the drawer IS the reading surface here.
Replaces the bare text node with three assertions that are strictly stronger:
the lifecycle row exists, it carries `data-variant="conversation-divider"`, and
its full text is the joined label. A variant flip and a dropped detail half now
each fail, where the old assertion could only see one span. Tests 08/10 in the
same spec never caught this because their `getByText` calls are non-exact and
match the joined label by substring.
Co-authored-by: Bradley Axen <baxen@squareup.com>
Signed-off-by: Bradley Axen <baxen@squareup.com>
Signed-off-by: ss-dev-00 <a02c4e0850e5e612b4ddf95dbe2f5c56467cf27c6552203bc833ff438fb31971@buzz.block.builderlab.xyz>
This commit is contained in:
@@ -606,9 +606,25 @@ test.describe("observer feed screenshots", () => {
|
||||
},
|
||||
]);
|
||||
|
||||
await expect(feedPanel.getByText("Commands", { exact: true })).toBeVisible({
|
||||
timeout: 5_000,
|
||||
});
|
||||
// This panel is the agent activity cover drawer, so it renders the reading
|
||||
// (`conversation`) variant, where a plain lifecycle status recedes to a
|
||||
// centered divider whose label joins the title and detail. The row is not
|
||||
// lost — the previous `getByText("Commands", { exact: true })` encoded the
|
||||
// dense variant's separate title span, so it stopped describing this
|
||||
// surface the moment the variant was pinned to the drawer.
|
||||
//
|
||||
// Asserting the row, its recede presentation and its full joined label is
|
||||
// strictly stronger than the bare text node it replaces: a variant flip or
|
||||
// a dropped detail half both fail here.
|
||||
const commandsRow = feedPanel
|
||||
.getByTestId("transcript-lifecycle-item")
|
||||
.filter({ hasText: "Commands available: 3" });
|
||||
await expect(commandsRow).toBeVisible({ timeout: 5_000 });
|
||||
await expect(commandsRow).toHaveAttribute(
|
||||
"data-variant",
|
||||
"conversation-divider",
|
||||
);
|
||||
await expect(commandsRow).toHaveText("Commands · Commands available: 3");
|
||||
await settleAnimations(feedPanel);
|
||||
await feedPanel.screenshot({
|
||||
path: `${SHOTS}/09-available-commands-update.png`,
|
||||
|
||||
Reference in New Issue
Block a user