Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Surface deactivated users in the search input & E2E fixes #125

Merged
merged 4 commits into from
Dec 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading