From 132d3fa5e9aeb2de29182a4ad51f7f7fc09858a8 Mon Sep 17 00:00:00 2001 From: godzylinux Date: Wed, 29 May 2024 23:24:30 +0330 Subject: [PATCH] chore: improved spinner query in tests --- frontend/tests/common-locators/spinner.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/tests/common-locators/spinner.ts b/frontend/tests/common-locators/spinner.ts index 1009a41b..0e136074 100644 --- a/frontend/tests/common-locators/spinner.ts +++ b/frontend/tests/common-locators/spinner.ts @@ -1,7 +1,7 @@ import { expect, type Locator } from '@playwright/test'; export function getSpinnerIn(locator: Locator) { - return locator.getByTestId('spinner-loading-state'); + return locator.getByTestId('spinner-loading-state').and(locator.locator(':visible')); } export async function waitForSpinnerStateToBeIdle(locator: Locator, timeout?: number) {