Skip to content

Commit 44b3357

Browse files
committed
add link to act and correct typo
1 parent f31d970 commit 44b3357

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

CONTRIBUTING.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ Twitter
5050

5151
Each component will at some point require at least one test to check it renders correctly. Each component in
5252
`mdx-embed/src/components/` is wrapped in what we call the **GeneralObserver** This component is responsible for
53-
ensuring the 3rd part embed script isn't invoked until the component has entered the viewport. This is particularly
53+
ensuring the 3rd party embed script isn't invoked until the component has entered the viewport. This is particularly
5454
important for Lighthouse scores and page load speeds. If a blog post page for example has 10 or 15 embed codes, Twitter,
5555
CodePend, YouTube etc on the page we don't want to load all that 3rd party JavaScript until the reader has scrolled down
5656
to where the component is used. When it scrolls in to view **GeneralObserver** which is an
@@ -61,9 +61,9 @@ This presents an issue when we come to test the components because we need to fa
6161
which allows the children of **GeneralObserver** to render.
6262

6363
To _mock_ this is a test we've globally exposed a method called `triggerGeneralObserver()` and since we're using Testing
64-
Library this state change must be wrapped in an `act`.
64+
Library this state change must be wrapped in an [act](https://testing-library.com/docs/react-testing-library/api#act).
6565

66-
With that said we require each `test(() => {})` to contain an `act()` and a call to `triggerGeneralObserver()`
66+
With that said we require each `test(() => {})` to contain an `act(() => {})` and a call to `triggerGeneralObserver()`
6767

6868
That looks like something like this: the `(window as any)` is a TypeScript thing... Paul is working on it.
6969

0 commit comments

Comments
 (0)