Skip to content

Commit b60e1ea

Browse files
committed
flow
1 parent 04b7906 commit b60e1ea

File tree

1 file changed

+3
-3
lines changed
  • exercises/03.best-practices/04.problem.element-presence

1 file changed

+3
-3
lines changed

exercises/03.best-practices/04.problem.element-presence/README.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# Element presence
22

3-
So far you've been finding and interacting with the elements that are either already present on the page or expected to eventually appear. But what about the cases when you need to check the opposite? That a certain UI element _did not_ render?
3+
So far we've covered finding and interacting with elements that are present or will appear on the page. But how do we test for elements that should _not_ render?
44

5-
This is where you would normally reach out to an [inverse assertion](https://www.epicweb.dev/inverse-assertions) to get a predictable result and guard yourself from false-positive tests:
5+
This is where you would normally reach for an [inverse assertion](https://www.epicweb.dev/inverse-assertions) to get a predictable result and guard yourself from false-positive tests:
66

77
```ts
88
const notificationVisiblePromise = vi.waitFor(() => {
@@ -23,4 +23,4 @@ await waitForElementToBeRemoved(notification)
2323

2424
**However, there's a more convenient way to do this in Vitest!**
2525

26-
👨‍💼 In this exercise, you will utilize the retry-ability of Vitest's `expect.element()` function to assert that the discount code has been removed from the UI once you click the respective button. Go to the <InlineFile file="./src/discount-code-form.browser.test.tsx">`discount-code-form.browser.test.tsx`</InlineFile> test suite and follow the instructions to complete a new test case.
26+
👨‍💼 In this exercise, you will use the retry-ability of Vitest's `expect.element()` function to assert that the discount code has been removed from the UI once you click the respective button. Go to the <InlineFile file="./src/discount-code-form.browser.test.tsx">`discount-code-form.browser.test.tsx`</InlineFile> test suite and follow the instructions to complete the new test case.

0 commit comments

Comments
 (0)