Browse Source

token toggling

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/4134/head
Pranav C 2 years ago
parent
commit
90de1e628f
  1. 2
      packages/nc-gui/components/account/Token.vue
  2. 9
      tests/playwright/pages/Account/Token.ts

2
packages/nc-gui/components/account/Token.vue

@ -160,7 +160,7 @@ const descriptionInput = ref((el) => {
<span v-else> {{ $t('general.show') }} </span>
</template>
<a-button type="text" class="!rounded-md" @click="record.show = !record.show">
<a-button type="text" class="!rounded-md nc-toggle-token-visibility" @click="record.show = !record.show">
<template #icon>
<MaterialSymbolsVisibilityOff v-if="record.show" class="flex mx-auto h-[1.1rem]" />
<MaterialSymbolsVisibility v-else class="flex mx-auto h-[1rem]" />

9
tests/playwright/pages/Account/Token.ts

@ -29,6 +29,15 @@ export class AccountTokenPage extends BasePage {
await this.verifyToast({ message: 'Token generated successfully' });
}
getTokenRow({ idx = 0 }) {
return this.get().locator(`tr:nth-child(${idx})`);
}
async toggleVisibility({ idx = 0 }) {
const row = this.getTokenRow({ idx });
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();

Loading…
Cancel
Save