Skip to content

Commit

Permalink
e2e
Browse files Browse the repository at this point in the history
  • Loading branch information
BenCookie95 committed Dec 9, 2024
1 parent 39b5f9f commit 90a2726
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion e2e/playwright/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ What this script does:
- `cd mattermost`
- Install webapp dependencies - `cd webapp && npm i`
- Install Playwright test dependencies - `cd ../e2e-tests/playwright && npm i`
- Install Playwright - `npx install playwright`
- Install Playwright - `npx playwright install`
- Install Legal Hold plugin e2e dependencies - `cd ../../../mattermost-plugin-legal-hold/e2e/playwright && npm i`
- Build and deploy plugin with e2e support - `make deploy`

Expand Down
8 changes: 5 additions & 3 deletions e2e/playwright/tests/create_legal_hold.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,14 @@ test('Admin user can create a legal hold successfully', async ({pw, pages}) => {

// Create legal hold
const legalHoldName = `New Hold ${getRandomId()}`;
const today = new Date().toLocaleDateString();
await createLegalHold(pluginPage, legalHoldName, [user.username], today);
const today = new Date();
const isoString = today.toISOString().split('T')[0]
await createLegalHold(pluginPage, legalHoldName, [user.username], isoString);

// Verify legal hold is created and details are correct
await expect(pluginPage.getLegalHold(legalHoldName)).toBeVisible();
expect(await pluginPage.getStartDate(legalHoldName)).toHaveText(today);
const dateString = today.toLocaleDateString('en-US');
expect(await pluginPage.getStartDate(legalHoldName)).toHaveText(dateString);
expect(await pluginPage.getEndDate(legalHoldName)).toHaveText('Never');
expect(await pluginPage.getUsers(legalHoldName)).toHaveText('1 users');
});

0 comments on commit 90a2726

Please sign in to comment.