Skip to content

Commit 5623abb

Browse files
tellahoCarl
andcommitted
test(desktop-messages): align smoke journeys with mention UX
Co-authored-by: Carl <acda9e433d19dcd0e6b6840f7f4b98f3a56f1fab98049d444c087019e6d36560@buzz.block.builderlab.xyz> Signed-off-by: Taylor Ho <[email protected]>
1 parent 70541f7 commit 5623abb

3 files changed

Lines changed: 34 additions & 13 deletions

File tree

‎desktop/tests/e2e/mentions.spec.ts‎

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1291,7 +1291,7 @@ test("selecting a persona mention reuses an existing persona agent", async ({
12911291
await expect(mentionChip).toHaveText("Fizz");
12921292
});
12931293

1294-
test("managed relay-profile agents with member roles use the agent address tray", async ({
1294+
test("managed relay-profile agents with member roles can be addressed explicitly", async ({
12951295
page,
12961296
}) => {
12971297
await installMockBridge(page, {
@@ -1317,9 +1317,17 @@ test("managed relay-profile agents with member roles use the agent address tray"
13171317
await input.fill("@char");
13181318

13191319
const dropdown = autocomplete(page);
1320-
await expect(dropdown.getByText("charlie")).toBeVisible();
1321-
await expect(dropdown.getByText("agent")).toBeVisible();
1322-
await input.press("Enter");
1320+
const charlieRow = dropdown.getByTestId(
1321+
`mention-suggestion-${TEST_IDENTITIES.charlie.pubkey}`,
1322+
);
1323+
await expect(charlieRow.getByText("charlie")).toBeVisible();
1324+
await expect(charlieRow.getByText("agent")).toBeVisible();
1325+
await charlieRow
1326+
.getByRole("button", {
1327+
name: "Automatically mention charlie",
1328+
exact: true,
1329+
})
1330+
.click();
13231331

13241332
await expect(input).toBeEmpty();
13251333
await expect(
@@ -2648,7 +2656,7 @@ test("system member-joined rows render the joined person as a plain profile name
26482656
await expect(joinedPersonName).not.toHaveAttribute("data-mention");
26492657
});
26502658

2651-
test("selecting a managed non-member agent from a DM addresses it", async ({
2659+
test("a managed non-member agent from a DM can be addressed explicitly", async ({
26522660
page,
26532661
}) => {
26542662
await installMockBridge(page, {
@@ -2668,10 +2676,18 @@ test("selecting a managed non-member agent from a DM addresses it", async ({
26682676
await input.fill("@char");
26692677

26702678
const dropdown = autocomplete(page);
2671-
await expect(dropdown.getByText("charlie")).toBeVisible();
2679+
const charlieRow = dropdown.getByTestId(
2680+
`mention-suggestion-${TEST_IDENTITIES.charlie.pubkey}`,
2681+
);
2682+
await expect(charlieRow.getByText("charlie")).toBeVisible();
26722683
await expect(autocomplete(page)).toHaveCount(1);
26732684
await expect(input.locator(".mention-chip")).toHaveCount(0);
2674-
await input.press("Enter");
2685+
await charlieRow
2686+
.getByRole("button", {
2687+
name: "Automatically mention charlie",
2688+
exact: true,
2689+
})
2690+
.click();
26752691

26762692
await expect(input).toBeEmpty();
26772693
await expect(input.locator(".mention-chip")).toHaveCount(0);

‎desktop/tests/e2e/persistent-agent-audience.spec.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ test("the mention button opens settings and can undo an address", async ({
347347
.toContain(AGENT_A);
348348
await expect(
349349
composer.getByTestId(`composer-address-lock-${AGENT_A}`),
350-
).toHaveCount(1);
350+
).toHaveCount(0);
351351
});
352352

353353
test("always-mentioned agents remain in the mention button while Enter-send resolves", async ({

‎desktop/tests/e2e/send-channel-binding.spec.ts‎

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,15 +77,20 @@ test("message with agent mention lands in compose-time channel despite mid-send
7777
await input.fill("@BotA");
7878

7979
const dropdown = autocomplete(page);
80-
const botRow = dropdown.locator("button", { hasText: "BotA" });
80+
const botRow = dropdown.getByTestId(
81+
`mention-suggestion-${OUT_OF_CHANNEL_BOT_PUBKEY}`,
82+
);
8183
await expect(botRow).toBeVisible();
8284
await expect(botRow.getByText("not in channel")).toBeVisible();
83-
// Select BotA from the autocomplete
84-
await input.press("Enter");
85-
await page.keyboard.type(` ${MESSAGE_TEXT}`);
85+
// Select BotA through the dedicated persistent-address action. Ordinary
86+
// selection intentionally remains an inline mention.
87+
await botRow
88+
.getByRole("button", { name: "Automatically mention BotA", exact: true })
89+
.click();
90+
await input.type(MESSAGE_TEXT);
8691

8792
// Verify the agent is addressed before submitting.
88-
await expect(input).toHaveText(` ${MESSAGE_TEXT}`);
93+
await expect(input).toHaveText(MESSAGE_TEXT);
8994
await expect(
9095
page.getByTestId(`composer-address-lock-${OUT_OF_CHANNEL_BOT_PUBKEY}`),
9196
).toBeVisible();

0 commit comments

Comments
 (0)