Browse Source

test(playwrite): password reset test correction

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/4134/head
Pranav C 2 years ago
parent
commit
9083a85434
  1. 2
      packages/nc-gui/lib/constants.ts
  2. 19
      packages/nc-gui/pages/account/index.vue
  3. 9
      packages/nc-gui/pages/account/index/users/[[nestedPage]].vue
  4. 2
      tests/playwright/tests/authChangePassword.spec.ts

2
packages/nc-gui/lib/constants.ts

@ -31,6 +31,7 @@ export const rolePermissions = {
exclude: {
appStore: true,
superAdminUserManagement: true,
superAdminAppSetting: true,
appLicense: true,
},
},
@ -38,6 +39,7 @@ export const rolePermissions = {
exclude: {
appStore: true,
superAdminUserManagement: true,
superAdminAppSetting: true,
appLicense: true,
},
},

19
packages/nc-gui/pages/account/index.vue

@ -27,18 +27,6 @@ const openKeys = ref([/^\/account\/users/.test($route.fullPath) && 'users'])
class="tabs-menu h-full"
mode="inline"
>
<!-- <a-menu-item
key="users-old"
class="group active:(!ring-0) hover:(!bg-primary !bg-opacity-25)"
@click="navigateTo('/account/users')"
>
<div class="flex items-center space-x-2">
<MdiAccountSupervisorOutline />
<div class="select-none">User Management</div>
</div>
</a-menu-item> -->
<div class="text-xs text-gray-500 ml-4 pt-4 pb-2 font-weight-bold">Account Settings</div>
<a-sub-menu key="users" class="!bg-white">
@ -58,7 +46,12 @@ const openKeys = ref([/^\/account\/users/.test($route.fullPath) && 'users'])
<a-menu-item key="password-reset" class="text-xs" @click="navigateTo('/account/users/password-reset')">
<span class="ml-4">Reset Password</span>
</a-menu-item>
<a-menu-item key="settings" class="text-xs" @click="navigateTo('/account/users/settings')">
<a-menu-item
v-if="isUIAllowed('superAdminAppSetting')"
key="settings"
class="text-xs"
@click="navigateTo('/account/users/settings')"
>
<span class="ml-4">Settings</span>
</a-menu-item>
</a-sub-menu>

9
packages/nc-gui/pages/account/index/users/[[nestedPage]].vue

@ -5,10 +5,15 @@ const { isUIAllowed } = useUIPermission()
</script>
<template>
<template v-if="$route.params.nestedPage === 'password-reset'">
<template
v-if="
$route.params.nestedPage === 'password-reset' ||
(!isUIAllowed('superAdminUserManagement') && !isUIAllowed('superAdminAppSetting'))
"
>
<LazyAccountResetPassword />
</template>
<template v-else-if="$route.params.nestedPage === 'settings' || !isUIAllowed('superAdminUserManagement')">
<template v-else-if="$route.params.nestedPage === 'settings' && !isUIAllowed('superAdminUserManagement')">
<LazyAccountSignupSettings />
</template>
<template v-else-if="isUIAllowed('superAdminUserManagement')">

2
tests/playwright/tests/authChangePassword.spec.ts

@ -18,7 +18,7 @@ test.describe('Auth', () => {
settings = dashboard.settings;
});
test('Change password', async ({ page }) => {
test.only('Change password', async ({ page }) => {
await dashboard.closeTab({ title: 'Team & Auth' });
await dashboard.gotoSettings();
await settings.selectTab({ tab: SettingTab.TeamAuth });

Loading…
Cancel
Save