diff --git a/apps/meteor/client/views/admin/ABAC/ABACAttributesTab/AttributesForm.spec.tsx b/apps/meteor/client/views/admin/ABAC/ABACAttributesTab/AttributesForm.spec.tsx index cb7ef05ad0eac..5cad3a2b227b1 100644 --- a/apps/meteor/client/views/admin/ABAC/ABACAttributesTab/AttributesForm.spec.tsx +++ b/apps/meteor/client/views/admin/ABAC/ABACAttributesTab/AttributesForm.spec.tsx @@ -69,6 +69,11 @@ describe('AttributesForm', () => { { wrapper: appRoot }, ); + // Making the form "touched" + const nameInput = screen.getByLabelText('Name*'); + await userEvent.type(nameInput, 'Test Attribute'); + await userEvent.clear(nameInput); + const saveButton = screen.getByRole('button', { name: 'Save' }); await userEvent.click(saveButton); diff --git a/apps/meteor/client/views/admin/ABAC/ABACAttributesTab/AttributesForm.tsx b/apps/meteor/client/views/admin/ABAC/ABACAttributesTab/AttributesForm.tsx index 390e4eccf2ba6..c3b63108646d4 100644 --- a/apps/meteor/client/views/admin/ABAC/ABACAttributesTab/AttributesForm.tsx +++ b/apps/meteor/client/views/admin/ABAC/ABACAttributesTab/AttributesForm.tsx @@ -31,7 +31,7 @@ const AttributesForm = ({ onSave, onCancel, description }: AttributesFormProps) const { handleSubmit, register, - formState: { errors }, + formState: { errors, isDirty }, watch, } = useFormContext(); @@ -125,7 +125,7 @@ const AttributesForm = ({ onSave, onCancel, description }: AttributesFormProps) - diff --git a/apps/meteor/client/views/admin/ABAC/ABACAttributesTab/__snapshots__/AttributesForm.spec.tsx.snap b/apps/meteor/client/views/admin/ABAC/ABACAttributesTab/__snapshots__/AttributesForm.spec.tsx.snap index ef0ce316ebcae..1a86494fc00c0 100644 --- a/apps/meteor/client/views/admin/ABAC/ABACAttributesTab/__snapshots__/AttributesForm.spec.tsx.snap +++ b/apps/meteor/client/views/admin/ABAC/ABACAttributesTab/__snapshots__/AttributesForm.spec.tsx.snap @@ -157,6 +157,7 @@ exports[`AttributesForm renders NewAttribute without crashing 1`] = ` - diff --git a/apps/meteor/tests/end-to-end/api/abac.ts b/apps/meteor/tests/end-to-end/api/abac.ts index 9779bf4df424a..c5c3e7cb2a7ad 100644 --- a/apps/meteor/tests/end-to-end/api/abac.ts +++ b/apps/meteor/tests/end-to-end/api/abac.ts @@ -1472,6 +1472,9 @@ const addAbacAttributesToUserDirectly = async (userId: string, abacAttributes: I after(async () => { await Promise.all(createdInviteIds.map((id) => request.delete(`${v1}/removeInvite/${id}`).set(credentials))); + + await deleteRoom({ type: 'p', roomId: plainRoomId }); + await deleteRoom({ type: 'p', roomId: managedRoomId }); }); }); });