Skip to content

Commit

Permalink
[MS] Added UserDetailsModal tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Ironicbay committed Dec 15, 2023
1 parent 9b392f0 commit dfdd86a
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 6 deletions.
2 changes: 1 addition & 1 deletion client/src/locales/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -785,7 +785,7 @@
"subtitles": {
"name": "Name",
"joined": "Joined",
"commonWorkspaces": "Common workspaces",
"commonWorkspaces": "Shared workspaces",
"revoked": "Revoked"
},
"actions": {
Expand Down
2 changes: 1 addition & 1 deletion client/src/views/users/UserContextMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export enum UserAction {
import UserDetailsModal from '@/views/users/UserDetailsModal.vue';
import { IonContent, IonIcon, IonItem, IonItemGroup, IonLabel, IonList, modalController, popoverController } from '@ionic/vue';
import { informationCircle, personRemove } from 'ionicons/icons';
import { UserProfile, UserInfo } from '@/parsec';
import { UserInfo } from '@/parsec';
const props = defineProps<{
user: UserInfo;
Expand Down
8 changes: 4 additions & 4 deletions client/src/views/users/UserDetailsModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
class="close-button"
@click="cancel"
>
Fermer
{{ $t('UsersPage.UserDetailsModal.actions.close') }}
</ion-button>
</ms-modal>
</ion-page>
Expand Down Expand Up @@ -123,7 +123,7 @@ import { defineProps, inject } from 'vue';
const { timeSince } = inject(FormattersKey)! as Formatters;
defineProps<{
user: UserInfo,
user: UserInfo;
}>();
function cancel(): Promise<boolean> {
Expand All @@ -141,7 +141,6 @@ function cancel(): Promise<boolean> {
margin-left: 50%;
margin-right: 20%;
}
}
.text2 {
font-size: 1.1rem;
Expand All @@ -150,7 +149,8 @@ function cancel(): Promise<boolean> {
&-right {
font-size: 1.1rem;
font-weight: 500;
color: var(--parsec-color-light-secondary-text); margin-left: 30%;
color: var(--parsec-color-light-secondary-text);
margin-left: 30%;
margin-right: auto;
}
}
Expand Down
31 changes: 31 additions & 0 deletions client/tests/e2e/specs/test_user_details_modal.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
// Parsec Cloud (https://parsec.cloud) Copyright (c) BUSL-1.1 2016-present Scille SAS

describe('Check active users page', () => {
beforeEach(() => {
cy.visitApp();
cy.login('Boby', 'P@ssw0rd.');
cy.get('.organization-card__manageBtn').click();
cy.get('.users-container').find('.user-list-item').eq(2).find('.options-button').invoke('show').click();
cy.get('.user-context-menu').find('.menu-list').find('ion-item').as('menuItems');
cy.get('@menuItems').eq(3).contains('View details').click();
});

afterEach(() => {
cy.dropTestbed();
});

it('Tests user details modal', () => {
cy.get('.ion-page').find('.ms-modal').as('modal').find('ion-header').contains('User details');
cy.get('@modal').find('.ms-modal-content').as('modal-content').should('contain', 'Name').and('contain', 'Joined');
// cspell:disable-next-line
cy.get('@modal-content').should('contain', 'Jaheira').and('contain', 'one second ago').and('contain', 'Shared workspaces');
cy.get('@modal-content').find('ion-list').find('ion-card').as('workspace-cards').should('have.length', 2);
cy.get('@workspace-cards').eq(0).find('ion-text').contains('Everyone');
cy.get('@workspace-cards').eq(0).find('ion-icon');
cy.get('@workspace-cards').eq(0).find('ion-label').contains('Administrator');
cy.get('@workspace-cards').eq(1).find('ion-text').contains('Development');
cy.get('@workspace-cards').eq(1).find('ion-icon');
cy.get('@workspace-cards').eq(1).find('ion-label').contains('Administrator');
cy.get('@modal-content').find('ion-button').contains('Close').click();
});
});

0 comments on commit dfdd86a

Please sign in to comment.