Skip to content

Commit

Permalink
fix(toast): fix timeout for frequently failing asynchronous test cases (
Browse files Browse the repository at this point in the history
#2118)

<!--
  How to write a good PR title:
- Follow [the Conventional Commits
specification](https://www.conventionalcommits.org/en/v1.0.0/).
  - Give as much context as necessary and as little as possible
  - Prefix it with [WIP] while it’s a work in progress
-->

## Self Checklist

- [x] I wrote a PR title in **English** and added an appropriate
**label** to the PR.
- [x] I wrote the commit message in **English** and to follow [**the
Conventional Commits
specification**](https://www.conventionalcommits.org/en/v1.0.0/).
- [x] I [added the
**changeset**](https://github.com/changesets/changesets/blob/main/docs/adding-a-changeset.md)
about the changes that needed to be released. (or didn't have to)
- [x] I wrote or updated **documentation** related to the changes. (or
didn't have to)
- [x] I wrote or updated **tests** related to the changes. (or didn't
have to)
- [x] I tested the changes in various browsers. (or didn't have to)
  - Windows: Chrome, Edge, (Optional) Firefox
  - macOS: Chrome, Edge, Safari, (Optional) Firefox

## Summary

왜인지 자주 실패하는 Toast의 autoDismiss 관련 비동기 테스트 케이스의 타이밍을 수정해봅니다.
dismiss 되는 딜레이를 줄이고, 테스트 케이스의 timeout을 100에서 1000으로 늘렸습니다.
  • Loading branch information
sungik-choi authored Mar 26, 2024
1 parent c15dddd commit 6f6d019
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/bezier-react/src/components/Toast/Toast.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,14 +85,14 @@ describe('Toast', () => {
it('should work if the option is on', async () => {
const { getByRole, queryByRole } = renderToast({
autoDismiss: true,
autoDismissTimeout: 10,
autoDismissTimeout: 0,
})
expect(getByRole('status')).toBeInTheDocument()
await waitFor(
() => {
expect(queryByRole('status')).not.toBeInTheDocument()
},
{ timeout: 100 }
{ timeout: 1000 }
)
})

Expand All @@ -103,7 +103,7 @@ describe('Toast', () => {
() => {
expect(queryByRole('status')).toBeInTheDocument()
},
{ timeout: 100 }
{ timeout: 1000 }
)
})
})
Expand Down

0 comments on commit 6f6d019

Please sign in to comment.