From bedfbb2e70532d8a9a0858786ea9dca902edea86 Mon Sep 17 00:00:00 2001 From: divdavem Date: Wed, 20 Nov 2024 15:08:37 +0100 Subject: [PATCH] fix(e2e): fix eslint playwright/expect-expect rule and configure as error (#1030) --- e2e/modal/modal.e2e-spec.ts | 8 ++++---- eslint.config.js | 1 + 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/e2e/modal/modal.e2e-spec.ts b/e2e/modal/modal.e2e-spec.ts index 6210da980b..3206115f93 100644 --- a/e2e/modal/modal.e2e-spec.ts +++ b/e2e/modal/modal.e2e-spec.ts @@ -77,20 +77,20 @@ Close`, await modalDemoPO.locatorRoot.waitFor(); await modalDemoPO.locatorLaunchDemoModalButton.click(); await modalPO.locatorDisableBackdropButton.click(); - await modalPO.locatorBackdrop.waitFor({state: 'hidden'}); + await expect(modalPO.locatorBackdrop).toBeHidden(); await modalPO.locatorEnableBackdropButton.click(); await modalPO.locatorBackdrop.waitFor(); await modalPO.locatorRoot.waitFor(); await modalPO.locatorLaunchOtherModalButton.click(); await otherModalPO.waitLoaded(); await otherModalPO.locatorDisableBackdropButton.click(); - await otherModalPO.locatorBackdrop.waitFor({state: 'hidden'}); + await expect(otherModalPO.locatorBackdrop).toBeHidden(); await otherModalPO.locatorEnableBackdropButton.click(); await otherModalPO.locatorBackdrop.waitFor(); await otherModalPO.locatorCloseButton.click(); - await otherModalPO.locatorRoot.waitFor({state: 'hidden'}); + await expect(otherModalPO.locatorRoot).toBeHidden(); await modalPO.locatorCloseButton.click(); - await modalPO.locatorRoot.waitFor({state: 'hidden'}); + await expect(modalPO.locatorRoot).toBeHidden(); }); test.describe.parallel(`Modal customizability`, () => { diff --git a/eslint.config.js b/eslint.config.js index 878d7ef3e9..4f1015d844 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -53,6 +53,7 @@ export default tseslint.config( rules: { ...playwright.configs['flat/recommended'].rules, 'playwright/no-conditional-in-test': 'off', + 'playwright/expect-expect': 'error', }, }, {