The communications platform that puts data protection first.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
Rocket.Chat/apps/meteor/client/hooks/useUserCustomFields.spec.tsx

22 lines
628 B

import { mockAppRoot } from '@rocket.chat/mock-providers';
import { renderHook, waitFor } from '@testing-library/react';
import { useUserCustomFields } from './useUserCustomFields';
it('should not break with invalid Accounts_CustomFieldsToShowInUserInfo setting', async () => {
const { result } = renderHook(
() =>
useUserCustomFields({
prop: 'value',
}),
{
wrapper: mockAppRoot()
.withSetting('Accounts_CustomFieldsToShowInUserInfo', '{"Invalid": "Object", "InvalidProperty": "Invalid" }')
.build(),
},
);
await waitFor(() => !!result.current);
expect(result.current).toEqual(undefined);
});