From f94f661d5de582c6efc820fda0c0ff009a7e16f4 Mon Sep 17 00:00:00 2001 From: Cody Olsen Date: Mon, 24 Feb 2025 20:04:29 +0100 Subject: [PATCH] chore: fix flaky test on CI --- packages/sanity/src/core/studio/Studio.test.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/sanity/src/core/studio/Studio.test.tsx b/packages/sanity/src/core/studio/Studio.test.tsx index 5557d3f838a6..42f3eb402c37 100644 --- a/packages/sanity/src/core/studio/Studio.test.tsx +++ b/packages/sanity/src/core/studio/Studio.test.tsx @@ -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) @@ -63,7 +63,8 @@ describe('Studio', () => { node.innerHTML = html document.head.innerHTML += sheet.getStyleTags() - act(() => hydrateRoot(node, )) + const root = await act(() => hydrateRoot(node, )) + await act(() => root.unmount()) } finally { sheet.seal() }