Skip to content

refactor(site): Show update notification as snackbar #7546

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 17, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add missed docs
  • Loading branch information
BrunoQuaresma committed May 16, 2023
commit 03267f936a6585941bb4f6d185368056ef84f39b
28 changes: 28 additions & 0 deletions docs/contributing/frontend.md
Original file line number Diff line number Diff line change
Expand Up @@ -166,3 +166,31 @@ user.click(screen.getByRole("button"))
const form = screen.getByTestId("form")
user.click(within(form).getByRole("button"))
```

#### `jest.spyOn` with the API is not working

For some unkown reason, we figured out the `jest.spyOn` is not able to mock the API function when they are passed directly into the services XState machine configuration.

❌ Does not work

```ts
import { getUpdateCheck } from "api/api"

createMachine({ ... }, {
services: {
getUpdateCheck,
},
})
```

✅ It works

```ts
import { getUpdateCheck } from "api/api"

createMachine({ ... }, {
services: {
getUpdateCheck: () => getUpdateCheck(),
},
})
```