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

Change placeholders #2626

Merged
merged 1 commit into from
May 15, 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 assets/js/pages/Users/EditUserPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ function EditUserPage() {
<UserForm
abilities={abilitiesState}
userAbilities={userAbilities}
saveText="Edit"
saveText="Save"
fullName={fullname}
emailAddress={email}
username={username}
Expand Down
10 changes: 5 additions & 5 deletions assets/js/pages/Users/EditUserPage.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ describe('EditUserPage', () => {
expect(screen.getAllByText(`${name}:${resource}`).length).toBe(1)
);

await user.click(screen.getByRole('button', { name: 'Edit' }));
await user.click(screen.getByRole('button', { name: 'Save' }));

expect(navigate).toHaveBeenCalledWith('/users');
expect(toast.success).toHaveBeenCalledWith(toastMessage);
Expand Down Expand Up @@ -151,7 +151,7 @@ describe('EditUserPage', () => {

await screen.findByText('Edit User');

await user.click(screen.getByRole('button', { name: 'Edit' }));
await user.click(screen.getByRole('button', { name: 'Save' }));

await screen.findByText('Error validating fullname');
});
Expand All @@ -173,7 +173,7 @@ describe('EditUserPage', () => {

await screen.findByText('Edit User');

await user.click(screen.getByRole('button', { name: 'Edit' }));
await user.click(screen.getByRole('button', { name: 'Save' }));

await screen.findByText('Information has been updated by another user', {
exact: false,
Expand All @@ -196,7 +196,7 @@ describe('EditUserPage', () => {

await screen.findByText('Edit User');

const editButton = screen.getByRole('button', { name: 'Edit' });
const editButton = screen.getByRole('button', { name: 'Save' });
expect(editButton).toBeDisabled();
const toolTipText = 'Admin user cannot be edited';
await user.hover(editButton);
Expand All @@ -218,7 +218,7 @@ describe('EditUserPage', () => {
route: `/users/${userData.id}/edit`,
});
await screen.findByText('Edit User');
await user.click(screen.getByRole('button', { name: 'Edit' }));
await user.click(screen.getByRole('button', { name: 'Save' }));
expect(toast.error).toHaveBeenCalledWith(TOAST_ERROR_MESSAGE);
});
});
1 change: 1 addition & 0 deletions assets/js/pages/Users/UserForm.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,7 @@ function UserForm({
<div className="col-start-2 col-span-3">
<MultiSelect
aria-label="permissions"
placeholder="Default"
values={mapAbilities(userAbilities)}
options={mapAbilities(abilities)}
onChange={(values) =>
Expand Down
2 changes: 1 addition & 1 deletion assets/js/pages/Users/UserForm.stories.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ export const Editing = {
createdAt,
updatedAt,
editing: true,
saveText: 'Edit',
saveText: 'Save',
},
};

Expand Down
4 changes: 2 additions & 2 deletions assets/js/pages/Users/UserForm.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -122,14 +122,14 @@ describe('UserForm', () => {

render(
<UserForm
saveText="Edit"
saveText="Save"
createdAt={createdAt}
updatedAt={updatedAt}
editing
/>
);

await user.click(screen.getByRole('button', { name: 'Edit' }));
await user.click(screen.getByRole('button', { name: 'Save' }));

expect(screen.getAllByText('Required field').length).toBe(3);
});
Expand Down
Loading