Skip to content

test(ui): fix toContainText call with two positional args silently dropping assertion #101

Description

@comnam90

Problem

tests/ui.spec.ts:565 calls Playwright's toContainText with two positional regex arguments:

await expect(dialog).toContainText(/5/i, /Services Tracked/i);

Playwright's signature is toContainText(expected, options?) — a single value (string/regex) or array, plus an optional options object. The second regex /Services Tracked/i is being silently coerced into the options arg and dropped. Only /5/i is actually asserted, which means the test under-asserts and the "Services Tracked" label is never verified.

The test still passes in CI because the first regex matches the dialog content, masking the missing assertion. This was flagged by Copilot during the v1.3.0 release review (PR #100).

Fix

Combine into a single regex or pass an array:

// Option A: single regex
await expect(dialog).toContainText(/5.*Services Tracked/is);

// Option B: array
await expect(dialog).toContainText([/5/i, /Services Tracked/i]);

Verify both 5 and Services Tracked text appear in the dialog after the fix.

Why not fixed in the release PR

Per gitflow, release/* branches stay limited to release-prep. Test fixes belong on develop via a separate PR.

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions