Skip to content

Commit 8171974

Browse files
author
npub12gtutshhh76rx0jx697f32f9tffd4hhp3hx58fp4x6u4uemkm7sqf8f757
committed
test(desktop): align virtualized smoke coverage
Co-authored-by: npub12gtutshhh76rx0jx697f32f9tffd4hhp3hx58fp4x6u4uemkm7sqf8f757 <5217c5c2f7bfb4333e46d17c98a9255a52dadee18dcd43a43536b95e6776dfa0@sprout-oss.stage.blox.sqprod.co> Signed-off-by: npub12gtutshhh76rx0jx697f32f9tffd4hhp3hx58fp4x6u4uemkm7sqf8f757 <5217c5c2f7bfb4333e46d17c98a9255a52dadee18dcd43a43536b95e6776dfa0@sprout-oss.stage.blox.sqprod.co>
1 parent 61b0f23 commit 8171974

2 files changed

Lines changed: 20 additions & 29 deletions

File tree

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

Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -160,10 +160,10 @@ async function expectWiderThanTall(locator: Locator) {
160160

161161
async function expectIntroActionIconStackedAboveTitle(
162162
action: Locator,
163-
testId: string,
163+
title: string,
164164
) {
165-
const iconBox = await action.getByTestId(`${testId}-icon`).boundingBox();
166-
const titleBox = await action.getByTestId(`${testId}-title`).boundingBox();
165+
const iconBox = await action.locator("svg").first().boundingBox();
166+
const titleBox = await action.getByText(title, { exact: true }).boundingBox();
167167
if (!iconBox || !titleBox) {
168168
throw new Error("Could not measure welcome intro action content");
169169
}
@@ -286,17 +286,13 @@ async function expectWelcomeView(page: Page) {
286286
);
287287
await expectIntroActionIconStackedAboveTitle(
288288
page.getByTestId("welcome-intro-action-create-channel"),
289-
"welcome-intro-action-create-channel",
289+
"Create a channel",
290290
);
291291
await expect(
292-
page.getByTestId("welcome-intro-action-create-channel-title"),
293-
).toHaveText("Create a channel");
294-
await expect(
295-
page.getByTestId("welcome-intro-action-create-channel-title"),
292+
page
293+
.getByTestId("welcome-intro-action-create-channel")
294+
.getByText("Create a channel", { exact: true }),
296295
).toHaveCSS("white-space", "normal");
297-
await expect(
298-
page.getByTestId("welcome-intro-action-create-channel-description"),
299-
).toHaveCount(0);
300296
await expect(
301297
page.getByTestId("welcome-intro-action-create-agent"),
302298
).toBeVisible();
@@ -305,14 +301,8 @@ async function expectWelcomeView(page: Page) {
305301
);
306302
await expectIntroActionIconStackedAboveTitle(
307303
page.getByTestId("welcome-intro-action-create-agent"),
308-
"welcome-intro-action-create-agent",
304+
"Create a custom agent",
309305
);
310-
await expect(
311-
page.getByTestId("welcome-intro-action-create-agent-title"),
312-
).toHaveText("Create a custom agent");
313-
await expect(
314-
page.getByTestId("welcome-intro-action-create-agent-description"),
315-
).toHaveCount(0);
316306
await expect(page.getByTestId("message-composer")).toBeVisible();
317307
await expect(page.getByTestId("welcome-composer-guide-banner")).toBeVisible();
318308
await expect(page.getByTestId("welcome-composer-guide-banner")).toContainText(

‎desktop/tests/e2e/relay-reconnect.spec.ts‎

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -183,24 +183,25 @@ test("reconnect backfills more missed channel messages than the live subscriptio
183183
});
184184

185185
// The virtualized timeline windows the oldest backfilled rows out of the DOM
186-
// while the user sits at the bottom, so the backfill depth can't be asserted
187-
// by expecting all 260 rows to be mounted at once. Scroll to the top and poll
188-
// until the oldest backfilled message mounts: reaching "missed 001" proves the
189-
// reconnect backfilled the full range past the live subscription limit, not
190-
// just the messages the live subscription would have delivered.
186+
// while the user sits at the bottom. Walk upward with real wheel input: the
187+
// older-history sentinel arms on a genuine leave→enter transition, and each
188+
// prepend restores the visible anchor away from the top. Reaching "missed
189+
// 001" proves reconnect backfilled past the live-subscription limit.
190+
await timeline.hover();
191191
await expect
192192
.poll(
193193
async () => {
194-
await timeline.evaluate((element) => {
195-
const scrollable = element as HTMLDivElement;
196-
scrollable.scrollTop = 0;
197-
scrollable.dispatchEvent(new Event("scroll", { bubbles: true }));
198-
});
194+
// Compact same-author rows can leave the restored viewport inside the
195+
// sentinel band. Move down first so the next upward gesture creates the
196+
// leave→enter transition that arms another bounded page.
197+
await page.mouse.wheel(0, 1200);
198+
await page.waitForTimeout(40);
199+
await page.mouse.wheel(0, -6000);
199200
return timeline.evaluate((element) =>
200201
(element.textContent ?? "").includes("reconnect e2e missed 001"),
201202
);
202203
},
203-
{ timeout: 15_000 },
204+
{ intervals: [100, 150, 250], timeout: 15_000 },
204205
)
205206
.toBe(true);
206207
});

0 commit comments

Comments
 (0)