Skip to content

Commit

Permalink
Surface deactivated users in the search input & E2E fixes (#125)
Browse files Browse the repository at this point in the history
* surface deactivated users in the search input
  • Loading branch information
BenCookie95 authored Dec 11, 2024
1 parent 5699618 commit 51cf32f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 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
9 changes: 5 additions & 4 deletions e2e/playwright/tests/create_legal_hold.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +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().toISOString().split('T')[0];
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();
const [year, month, day] = today.split('-');
expect(await pluginPage.getStartDate(legalHoldName)).toHaveText(`${month}/${day}/${year}`);
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');
});
2 changes: 1 addition & 1 deletion webapp/src/components/users_input/users_input.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export default class UsersInput extends React.Component {
};

debouncedSearchProfiles = debounce((term, callback) => {
this.props.actions.searchProfiles(term).then(({data}) => {
this.props.actions.searchProfiles(term, {allow_inactive: true}).then(({data}) => {
callback(data);
}).catch(() => {
// eslint-disable-next-line no-console
Expand Down

0 comments on commit 51cf32f

Please sign in to comment.