From ff23b4332f5dc0246e6698225eea91a75e238da7 Mon Sep 17 00:00:00 2001 From: Michael Matloka Date: Mon, 13 Nov 2023 20:37:49 +0100 Subject: [PATCH] Wait for loaders more reliably --- .storybook/test-runner.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.storybook/test-runner.ts b/.storybook/test-runner.ts index cf02d028151b9..8decd13e17a65 100644 --- a/.storybook/test-runner.ts +++ b/.storybook/test-runner.ts @@ -121,7 +121,7 @@ async function expectStoryToMatchSnapshot( document.body.classList.add('storybook-test-runner') }) if (waitForLoadersToDisappear) { - await Promise.all(LOADER_SELECTORS.map((selector) => page.waitForSelector(selector, { state: 'detached' }))) + await page.waitForSelector(LOADER_SELECTORS.join(','), { state: 'detached' }) } if (waitForSelector) { await page.waitForSelector(waitForSelector)