From 4cd2f21447048cc4ff55d4785e45322a72b11f1f Mon Sep 17 00:00:00 2001 From: braks <78412429+bcakmakoglu@users.noreply.github.com> Date: Tue, 4 Oct 2022 22:53:03 +0200 Subject: [PATCH] chore(tests): cleanup --- packages/nc-gui/assets/style.scss | 4 +-- packages/nc-gui/pages/index/index/user.vue | 2 +- packages/nc-gui/pages/index/user/index.vue | 0 .../integration/common/6h_change_password.js | 25 ++++++++++++------- 4 files changed, 19 insertions(+), 12 deletions(-) delete mode 100644 packages/nc-gui/pages/index/user/index.vue diff --git a/packages/nc-gui/assets/style.scss b/packages/nc-gui/assets/style.scss index 1c4fb266c1..7df65992f7 100644 --- a/packages/nc-gui/assets/style.scss +++ b/packages/nc-gui/assets/style.scss @@ -214,11 +214,11 @@ a { } &:hover::after { - @apply !border-0 transform scale-110 ring ring-accent ring-opacity-100; + @apply transform scale-110 ring ring-accent; } &:active::after { - @apply ring ring-accent ring-opacity-100; + @apply ring ring-accent; } } diff --git a/packages/nc-gui/pages/index/index/user.vue b/packages/nc-gui/pages/index/index/user.vue index 3f69d8fd70..9ac26c73b0 100644 --- a/packages/nc-gui/pages/index/index/user.vue +++ b/packages/nc-gui/pages/index/index/user.vue @@ -147,7 +147,7 @@ const resetError = () => { .create { .ant-input-affix-wrapper, .ant-input { - @apply !appearance-none my-1 border-1 border-solid rounded; + @apply !appearance-none my-1 border-1 border-solid border-primary border-opacity-50 rounded; } } } diff --git a/packages/nc-gui/pages/index/user/index.vue b/packages/nc-gui/pages/index/user/index.vue deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/scripts/cypress/integration/common/6h_change_password.js b/scripts/cypress/integration/common/6h_change_password.js index bfe867348d..7ccc4747ab 100644 --- a/scripts/cypress/integration/common/6h_change_password.js +++ b/scripts/cypress/integration/common/6h_change_password.js @@ -2,12 +2,14 @@ import { isTestSuiteActive, roles } from "../../support/page_objects/projectCons const newPassword = `${roles.owner.credentials.password}1`; +const currentPasswordIsWrong = "Current password is wrong"; +const passwordsNotMatching = "Passwords do not match"; export const genTest = (apiType, dbType) => { if (!isTestSuiteActive(apiType, dbType)) return; - describe('User settings test', () => { - it('Visit user settings', () => { + describe('User settings', () => { + it('Visit user settings page', () => { cy.get("[data-cy='nc-noco-brand-icon']").click(); cy.get("[data-cy='nc-menu-accounts']").click(); @@ -16,7 +18,7 @@ export const genTest = (apiType, dbType) => { cy.get("[data-cy='nc-user-settings-form']").should("exist"); }); - describe('Change password', () => { + describe('Update password and verify user settings form validation', () => { beforeEach(() => { cy.get("[data-cy='nc-user-settings-form__current-password']").clear(); cy.get("[data-cy='nc-user-settings-form__new-password']").clear(); @@ -28,29 +30,34 @@ export const genTest = (apiType, dbType) => { cy.get("[data-cy='nc-user-settings-form__new-password']").type(newPassword); cy.get("[data-cy='nc-user-settings-form__new-password-repeat']").type(newPassword); cy.get("[data-cy='nc-user-settings-form__submit']").click(); - cy.get("[data-cy='nc-user-settings-form__error']").should("exist").should("contain", "Current password is wrong"); + cy.get("[data-cy='nc-user-settings-form__error']").should("exist").should("contain", currentPasswordIsWrong); }); - it('Verifies matching passwords', () => { + it('Verifies passwords match', () => { cy.get("[data-cy='nc-user-settings-form__current-password']").type(roles.owner.credentials.password); cy.get("[data-cy='nc-user-settings-form__new-password']").type(newPassword); - cy.get("[data-cy='nc-user-settings-form__new-password-repeat']").type(newPassword + 'NotMatching'); + cy.get("[data-cy='nc-user-settings-form__new-password-repeat']").type(`${newPassword}NotMatching`); cy.get("[data-cy='nc-user-settings-form__submit']").click(); - cy.get(".ant-form-item-explain-error").should("exist").should("contain", "Passwords do not match"); + cy.get(".ant-form-item-explain-error").should("exist").should("contain", passwordsNotMatching); }); - it('Change user password using valid password', () => { + it('Changes user password & signs out', () => { cy.get("[data-cy='nc-user-settings-form__current-password']").type(roles.owner.credentials.password); cy.get("[data-cy='nc-user-settings-form__new-password']").type(newPassword); cy.get("[data-cy='nc-user-settings-form__new-password-repeat']").type(newPassword); cy.get("[data-cy='nc-user-settings-form__submit']").click(); cy.get("[data-cy='nc-user-settings-form__submit']").should("not.exist"); + }); + }) + + describe('Sign in with new password', () => { + it('Verifies new password works', () => { cy.get("[data-cy='nc-form-signin']").should("exist"); cy.get("[data-cy='nc-form-signin__email']").type(roles.owner.credentials.username); cy.get("[data-cy='nc-form-signin__password']").type(newPassword); cy.get("[data-cy='nc-form-signin__submit']").click(); cy.get("[data-cy='nc-menu-accounts']").should("exist"); - }); + }) }) }); };