Skip to content

Commit

Permalink
Fix Jest 9
Browse files Browse the repository at this point in the history
  • Loading branch information
Zacqary committed Oct 2, 2024
1 parent c1d2552 commit 1f3b3d1
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ describe('Case View Page files tab', () => {
exact: false,
});

expect(customFields.length).toBe(4);
expect(customFields.length).toBe(6);

expect(await within(customFields[0]).findByRole('heading')).toHaveTextContent(
'My test label 1'
Expand All @@ -103,6 +103,12 @@ describe('Case View Page files tab', () => {
expect(await within(customFields[3]).findByRole('heading')).toHaveTextContent(
'My test label 4'
);
expect(await within(customFields[4]).findByRole('heading')).toHaveTextContent(
'My test label 5'
);
expect(await within(customFields[5]).findByRole('heading')).toHaveTextContent(
'My test label 6'
);
});

it('pass the permissions to custom fields correctly', async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ import {
AttachmentType,
ConnectorTypes,
CustomFieldTypes,
type CustomFieldConfiguration,
} from '../../../common/types/domain';
import { useAvailableCasesOwners } from '../app/use_available_owners';
import type { CreateCaseFormFieldsProps } from './form_fields';
Expand Down Expand Up @@ -496,7 +497,7 @@ describe('Create case', () => {
type: CustomFieldTypes.TEXT,
label: 'my custom field label',
required: false,
},
} as CustomFieldConfiguration,
],
},
];
Expand Down Expand Up @@ -544,6 +545,8 @@ describe('Create case', () => {
{ ...customFieldsMock[1], value: false }, // toggled the default
customFieldsMock[2],
{ ...customFieldsMock[3], value: false },
customFieldsMock[4],
customFieldsMock[5],
{
key: 'my_custom_field_key',
type: CustomFieldTypes.TEXT,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,6 @@ describe('configureToggleCustomFieldFactory ', () => {
label: 'Toggle',
getEuiTableColumn: expect.any(Function),
build: expect.any(Function),
filterOptions: [
{ key: 'on', label: 'On', value: true },
{ key: 'off', label: 'Off', value: false },
],
getDefaultValue: expect.any(Function),
convertValueToDisplayText: expect.any(Function),
getFilterOptions: expect.any(Function),
Expand Down

0 comments on commit 1f3b3d1

Please sign in to comment.