Skip to content

Commit

Permalink
[MS] Resync web bindings
Browse files Browse the repository at this point in the history
  • Loading branch information
Max-7 committed Jan 29, 2025
1 parent c9a8b05 commit 2dec946
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 18 deletions.
8 changes: 4 additions & 4 deletions client/tests/e2e/specs/client_area_dashboard.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Parsec Cloud (https://parsec.cloud) Copyright (c) BUSL-1.1 2016-present Scille SAS

import { DEFAULT_ORGANIZATION_INFORMATION, expect, msTest } from '@tests/e2e/helpers';
import { expect, msTest } from '@tests/e2e/helpers';

msTest('Test dashboard', async ({ clientArea }) => {
const title = clientArea.locator('.header-content').locator('.header-title');
Expand All @@ -15,19 +15,19 @@ msTest('Test dashboard', async ({ clientArea }) => {
await expect(invoices).toHaveCount(3);
await expect(invoices.nth(0).locator('.invoices-list-item__data')).toHaveText([
'Dec 1, 2021',
DEFAULT_ORGANIZATION_INFORMATION.name,
clientArea.orgInfo.name,
/^[\d.,]+$/,
/^(Paid|In progress|To pay)\s*Download$/,
]);
await expect(invoices.nth(1).locator('.invoices-list-item__data')).toHaveText([
'Nov 1, 2021',
DEFAULT_ORGANIZATION_INFORMATION.name,
clientArea.orgInfo.name,
/^[\d.,]+$/,
/^(Paid|In progress|To pay)\s*Download$/,
]);
await expect(invoices.nth(2).locator('.invoices-list-item__data')).toHaveText([
'Oct 1, 2021',
DEFAULT_ORGANIZATION_INFORMATION.name,
clientArea.orgInfo.name,
/^[\d.,]+$/,
/^(Paid|In progress|To pay)\s*Download$/,
]);
Expand Down
4 changes: 2 additions & 2 deletions client/tests/e2e/specs/client_area_invoices_page.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Parsec Cloud (https://parsec.cloud) Copyright (c) BUSL-1.1 2016-present Scille SAS

import { DEFAULT_ORGANIZATION_INFORMATION, MockBms, expect, msTest } from '@tests/e2e/helpers';
import { MockBms, expect, msTest } from '@tests/e2e/helpers';

msTest('List the invoices', async ({ clientArea }) => {
await MockBms.mockGetInvoices(clientArea);
Expand All @@ -17,7 +17,7 @@ msTest('List the invoices', async ({ clientArea }) => {
await expect(containers.nth(0).locator('.invoices-year-content-list-item').nth(0).locator('ion-text')).toHaveText([
'Dec 2021',
'2021-12',
DEFAULT_ORGANIZATION_INFORMATION.name,
clientArea.orgInfo.name,
/^[\d.,]+$/,
/^(Paid|In progress|To pay)\s*Download$/,
]);
Expand Down
16 changes: 4 additions & 12 deletions client/tests/e2e/specs/client_area_login.spec.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,6 @@
// Parsec Cloud (https://parsec.cloud) Copyright (c) BUSL-1.1 2016-present Scille SAS

import {
DEFAULT_ORGANIZATION_INFORMATION,
DEFAULT_USER_INFORMATION,
MockBms,
answerQuestion,
expect,
fillIonInput,
msTest,
} from '@tests/e2e/helpers';
import { DEFAULT_USER_INFORMATION, MockBms, answerQuestion, expect, fillIonInput, msTest } from '@tests/e2e/helpers';

msTest('Log into the customer area', async ({ home }) => {
await MockBms.mockLogin(home);
Expand Down Expand Up @@ -81,8 +73,8 @@ msTest('Switch pages', async ({ clientArea }) => {
});

msTest('Switch org', async ({ clientArea }) => {
const org1 = DEFAULT_ORGANIZATION_INFORMATION.name;
const org2 = `${DEFAULT_ORGANIZATION_INFORMATION.name}-2`;
const org1 = clientArea.orgInfo.name;
const org2 = `${clientArea.orgInfo.name}-2`;

const orgSwitchButton = clientArea.locator('.sidebar-header').locator('.card-header-title');
await expect(orgSwitchButton).toHaveText(org1);
Expand Down Expand Up @@ -151,7 +143,7 @@ for (const frozen of [false, true]) {
const popover = home.locator('.popover-switch');
const orgs = popover.locator('.organization-list').getByRole('listitem');
await orgs.nth(0).click();
await expect(orgSwitchButton).toHaveText(DEFAULT_ORGANIZATION_INFORMATION.name);
await expect(orgSwitchButton).toHaveText(home.orgInfo.name);

const orgState = home.locator('.sidebar').locator('.sidebar-header').locator('.organization-card-state');
await expect(orgState).toHaveText(frozen ? 'State: Frozen' : 'State: Active');
Expand Down

0 comments on commit 2dec946

Please sign in to comment.