Skip to content

Commit

Permalink
docs: fix issue with urls not found
Browse files Browse the repository at this point in the history
  • Loading branch information
kark committed Jun 17, 2022
1 parent a4ff747 commit ed138f3
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions website/src/content/development/testing.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,6 @@ Let's set things up. First, we need to configure Mock Service Worker to create a
In our test we then mock all necessary API requests. If a network request is not properly mocked, Mock Service Worker will let you know.<br />
Our Channels page sends a `FetchChannels` GraphQL query, therefore we need to use the `graphql.query` handler matching the name of the query: `FetchChannels`.

```js title="channels.spec.js"
import { graphql } from 'msw';

<MultiCodeExample title='channels.spec'>
<CodeExample path="development/testing/mock-api-request.jsx" />
<CodeExample path="development/testing/mock-api-request.tsx" />
Expand Down Expand Up @@ -97,7 +94,7 @@ You get the idea.
Let's enhance our test to paginate to page two. First we need to adjust our GraphQL mock to return results based on the `offset` from the query variables. Then we need to interact with the pagination button to go to the next page.

<MultiCodeExample title='channels.spec'>
<CodeExample path="development/testing/pagination-and-button-interaction.jsx" highlightLines={["1,5,6,7,14,30,31,34,37,38]} />
<CodeExample path="development/testing/pagination-and-button-interaction.jsx" highlightLines={[1,5,6,7,14,30,31,34,37,38]} />
<CodeExample path="development/testing/pagination-and-button-interaction.tsx" highlightLines={[1,5,6,7,14,30,31,34,37,38]} />
</MultiCodeExample>

Expand Down

0 comments on commit ed138f3

Please sign in to comment.