Skip to content

test(tabs): assert tab presence instead of guarding e2e checks#6820

Open
voidmatcha wants to merge 1 commit into
valor-software:developmentfrom
voidmatcha:test/issue-823-tab-ordering-assertions
Open

test(tabs): assert tab presence instead of guarding e2e checks#6820
voidmatcha wants to merge 1 commit into
valor-software:developmentfrom
voidmatcha:test/issue-823-tab-ordering-assertions

Conversation

@voidmatcha

Copy link
Copy Markdown

PR Checklist

  • read and followed the CONTRIBUTING.md guide.
  • built and tested the changes locally.
  • added/updated tests.
  • added/updated API documentation.
  • added/updated demos.

What

The Issue #823 tab-ordering specs in e2e/issues/issue-823.spec.ts wrap their assertions in
if (count > 0) guards. When a selector matches nothing the body is skipped and the test passes
without asserting anything, which hides a real regression (for example the tab strip failing to
render). The describe setup already awaits page.waitForSelector('.nav-tabs'), so the nav links and
items those guards check are guaranteed to be present by the time the body runs.

Change

Replace the guards that depend on that guaranteed state with explicit expect(...).toBeGreaterThan(0)
assertions, so a missing tab strip now fails the test instead of passing silently. Five tests are
updated; the assertions inside each guard are preserved unchanged.

Guards left untouched on purpose:

  • the >= 2 minimum-count paths, where two tabs are not guaranteed by setup
  • the optional add/remove control checks, which test genuinely conditional UI

Testing

Static review only. npm install and the Playwright e2e run were not executed in this environment due
to a time limit, so the spec was not run locally. The change uses the same expect/locator APIs
already present in the file and only converts guards into assertions.


Found while reviewing the test suite with e2e-skills/e2e-reviewer.

The issue-823 tab ordering specs wrapped their assertions in if (count > 0)
guards, so a selector that matched nothing skipped the body and the test
passed without asserting anything. The describe setup already waits for
.nav-tabs to render, so the nav links and items are guaranteed present.

Replace the guards that depend on that guaranteed state with explicit
expect(...).toBeGreaterThan(0) checks so a missing tab strip now fails the
test instead of passing silently. Guards over genuinely optional controls
(add/remove buttons) and minimum-count paths are left untouched.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant