From 67a4d1ce337aa69fb5ee8c92a3613acf03483027 Mon Sep 17 00:00:00 2001 From: sreehari jayaraj Date: Thu, 21 Sep 2023 22:34:23 +0530 Subject: [PATCH] fix: test delete modal --- packages/nc-gui/components/account/Token.vue | 8 ++++++-- tests/playwright/pages/Account/Token.ts | 10 ++-------- .../db/usersAccounts/accountTokenManagement.spec.ts | 2 +- 3 files changed, 9 insertions(+), 11 deletions(-) diff --git a/packages/nc-gui/components/account/Token.vue b/packages/nc-gui/components/account/Token.vue index ed4fbc7e11..48f4d51eb1 100644 --- a/packages/nc-gui/components/account/Token.vue +++ b/packages/nc-gui/components/account/Token.vue @@ -174,6 +174,10 @@ const descriptionInput: VNodeRef = (el) => (el as HTMLInputElement)?.focus() +
+ +
+
@@ -181,12 +185,12 @@ const descriptionInput: VNodeRef = (el) => (el as HTMLInputElement)?.focus() - + {{ el.created_by }} - + {{ el.token }} ********************************** diff --git a/tests/playwright/pages/Account/Token.ts b/tests/playwright/pages/Account/Token.ts index 3f674e8755..9f19ad3550 100644 --- a/tests/playwright/pages/Account/Token.ts +++ b/tests/playwright/pages/Account/Token.ts @@ -41,16 +41,10 @@ export class AccountTokenPage extends BasePage { await row.locator('.nc-toggle-token-visibility').click(); } - async openRowActionMenu({ description }: { description: string }) { - const userRow = this.get().locator(`tr:has-text("${description}")`); - return userRow.locator(`.nc-token-menu`).click(); - } - async deleteToken({ description }: { description: string }) { - await this.openRowActionMenu({ description }); - await this.rootPage.locator('[data-testid="nc-token-row-action-icon"] .nc-delete-token').click(); + await this.rootPage.locator('[data-testid="nc-token-row-action-icon"]').click(); await this.rootPage.locator('.ant-modal.active button:has-text("Delete Token")').click(); - expect(await this.get().locator(`tr:has-text("${description}:visible")`).count()).toBe(0); + expect(await this.get().locator(`span:has-text("${description}:visible")`).count()).toBe(0); } } diff --git a/tests/playwright/tests/db/usersAccounts/accountTokenManagement.spec.ts b/tests/playwright/tests/db/usersAccounts/accountTokenManagement.spec.ts index dca2104925..60df62fc30 100644 --- a/tests/playwright/tests/db/usersAccounts/accountTokenManagement.spec.ts +++ b/tests/playwright/tests/db/usersAccounts/accountTokenManagement.spec.ts @@ -19,7 +19,7 @@ test.describe('User roles', () => { await unsetup(context); }); - test.only('Create and Delete token', async () => { + test('Create and Delete token', async () => { test.slow(); const parallelId = process.env.TEST_PARALLEL_INDEX ?? '0'; await accountTokenPage.goto();