Skip to content

Commit

Permalink
chore: fix flaky test on CI
Browse files Browse the repository at this point in the history
  • Loading branch information
stipsan committed Feb 24, 2025
1 parent 9b4886f commit f94f661
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/sanity/src/core/studio/Studio.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ describe('Studio', () => {
spy.mockReset()
spy.mockRestore()
})
it(`SSR to markup for hydration doesn't throw`, () => {
it(`SSR to markup for hydration doesn't throw`, async () => {
const spy = vi.spyOn(console, 'error')
const node = document.createElement('div')
document.body.appendChild(node)
Expand All @@ -63,7 +63,8 @@ describe('Studio', () => {
node.innerHTML = html

document.head.innerHTML += sheet.getStyleTags()
act(() => hydrateRoot(node, <Studio config={config} />))
const root = await act(() => hydrateRoot(node, <Studio config={config} />))
await act(() => root.unmount())
} finally {
sheet.seal()
}
Expand Down

0 comments on commit f94f661

Please sign in to comment.