Skip to content

performance.spec.ts tests end on a wait, not an assertion — T167 never paginates #745

Description

@TortoiseWolfe

Several tests in tests/e2e/messaging/performance.spec.ts do not exercise the behaviour their
names describe. The clearest:

test('T167: Pagination loads next 50 messages', async ({ browser }) => {
  const viewer = await openAsViewer(browser, fixture!);
  try {
    await expectConversationLoaded(viewer);
    // Wait for initial messages to load and stabilize.
    await settleFrames(viewer.page);
  } finally {
    await viewer.close();
  }
});

It opens a conversation, asserts the conversation loaded, waits three animation frames, and
closes. It never paginates. The only assertion is one that any loaded conversation passes,
so the test is green whether pagination works, is broken, or is deleted.

Nine calls in that file are the last statement before viewer.close(), which is the signature:
the test ends on a wait rather than on a check.

Why this is worth fixing rather than shrugging at

This is the same family the repo keeps paying for, and there are three fresh examples from one
week: the regex guard that predicted #723 and stayed green through it; the
if (await jumpButton.isVisible()) wrapper that made T009 vacuous whenever the button was
missing — the single failure its name promised to catch; and three tests named for colour
contrast that never measured a ratio.

It matters more now than it did: e2e-local.yml runs on every PR (#575 Phase 3) and is
intended to become a required check. Tests that cannot fail dilute the signal that decision
rests on.

What to do

Go through the file test by test and ask what each name claims, then make it assert that:

  • T167 — capture the rendered message count, trigger pagination (scroll to top / click the
    loader), and assert the count grew by the expected page size.
  • Jump to bottom with smooth scroll — it already guards on if (jumpVisible), so it is
    vacuous whenever the button is absent. Assert the button is present (as T009 now does), then
    poll the scroll position, exactly as messaging-scroll.spec.ts T009 was fixed.
  • Any test whose body ends in settleFrames almost certainly ends without a check.

Where a behaviour genuinely cannot be exercised in this environment, test.fixme with a reason
is honest; a green test that asserts nothing is not.

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions