Skip to content

Commit

Permalink
fix: fixed test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
BowlingX committed Nov 21, 2023
1 parent 2f1f828 commit 349ed0f
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/__tests__/static-render.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ describe('<StaticGeschichteProvider />', () => {
onClick={() =>
void batchReplaceState(['default'], (state) => {
if (state) {
state.someParameter = 'nextBatchPushState'
state.someParameter = 'nextBatchReplaceState'
}
})
}
Expand Down Expand Up @@ -106,9 +106,9 @@ describe('<StaticGeschichteProvider />', () => {
expect(screen.getByRole('content').textContent).toEqual('nextReplaceState')
})

it('should support batchPushState', async () => {
it('should support batch handling', async () => {
render(
<Geschichte>
<Geschichte search="?parameter=myValue">
<ComponentThatRendersSomethingStatically />
</Geschichte>
)
Expand All @@ -118,5 +118,11 @@ describe('<StaticGeschichteProvider />', () => {
expect(screen.getByRole('content').textContent).toEqual(
'nextBatchPushState'
)
await act(async () => {
await userEvent.click(screen.getByRole('batchReplace'))
})
expect(screen.getByRole('content').textContent).toEqual(
'nextBatchReplaceState'
)
})
})

0 comments on commit 349ed0f

Please sign in to comment.