Inverse of the existing be.visible. Reuses the isVisible helper already in src/asserts/index.ts.
Scope
- New case in
src/asserts/index.ts returning !isVisible(el).
- Unit test in
src/tests/asserts/.
- Add a row in
docs/api/assertions.md.
- Add an element with
display: none and data-testid="be-hidden" in examples/twd-test-app/src/pages/Assertions.tsx.
- Example test uses
screenDom.getByTestId("be-hidden") + twd.should(el, "be.hidden").
Reference
be.visible implementation in src/asserts/index.ts.
Acceptance criteria
How to contribute
Read CONTRIBUTING.md first. Quick steps for this issue:
- Fork, clone, create a feature branch:
git checkout -b feat/be-hidden-assertion.
- From the repo root, build the library and sync it to the example apps:
npm install
npm run build
npm run copy:mock-sw
- Install and run the test app:
cd examples/twd-test-app
npm install
npm run dev
- Open the app in the browser — the TWD sidebar appears on the right. Run your new tests from the sidebar and confirm they pass.
- Run the library's unit tests from the repo root:
npm run test:ci.
- Open the PR with screenshots of the sidebar showing green tests.
Always prefer screenDom (Testing Library) for element queries. Avoid twd.get() in new code.
Inverse of the existing
be.visible. Reuses theisVisiblehelper already insrc/asserts/index.ts.Scope
src/asserts/index.tsreturning!isVisible(el).src/tests/asserts/.docs/api/assertions.md.display: noneanddata-testid="be-hidden"inexamples/twd-test-app/src/pages/Assertions.tsx.screenDom.getByTestId("be-hidden")+twd.should(el, "be.hidden").Reference
be.visibleimplementation insrc/asserts/index.ts.Acceptance criteria
npm run test:ciis green.twd-test-app.docs/api/assertions.mdupdated.How to contribute
Read CONTRIBUTING.md first. Quick steps for this issue:
git checkout -b feat/be-hidden-assertion.cd examples/twd-test-app npm install npm run devnpm run test:ci.