diff --git a/packages/twenty-front/src/modules/object-record/field/__mocks__/fieldDefinitions.ts b/packages/twenty-front/src/modules/object-record/field/__mocks__/fieldDefinitions.ts new file mode 100644 index 000000000..5adb123ae --- /dev/null +++ b/packages/twenty-front/src/modules/object-record/field/__mocks__/fieldDefinitions.ts @@ -0,0 +1,100 @@ +import { FieldDefinition } from '@/object-record/field/types/FieldDefinition'; +import { + FieldBooleanMetadata, + FieldFullNameMetadata, + FieldLinkMetadata, + FieldPhoneMetadata, + FieldRatingMetadata, + FieldRelationMetadata, + FieldSelectMetadata, + FieldTextMetadata, +} from '@/object-record/field/types/FieldMetadata'; + +export const fieldMetadataId = 'fieldMetadataId'; + +export const textfieldDefinition: FieldDefinition = { + fieldMetadataId, + label: 'User Name', + iconName: 'User', + type: 'TEXT', + metadata: { placeHolder: 'John Doe', fieldName: 'userName' }, +}; + +export const booleanFieldDefinition: FieldDefinition = { + fieldMetadataId, + label: 'Is Active?', + iconName: 'iconName', + type: 'BOOLEAN', + metadata: { + objectMetadataNameSingular: 'person', + fieldName: 'isActive', + }, +}; + +export const relationFieldDefinition: FieldDefinition = { + fieldMetadataId, + label: 'Contact', + iconName: 'Phone', + type: 'RELATION', + metadata: { + fieldName: 'contact', + relationFieldMetadataId: 'relationFieldMetadataId', + relationObjectMetadataNamePlural: 'users', + relationObjectMetadataNameSingular: 'user', + }, +}; + +export const selectFieldDefinition: FieldDefinition = { + fieldMetadataId, + label: 'Account Owner', + iconName: 'iconName', + type: 'SELECT', + metadata: { + fieldName: 'accountOwner', + options: [{ label: 'Elon Musk', color: 'blue', value: 'userId' }], + }, +}; + +export const fullNameFieldDefinition: FieldDefinition = { + fieldMetadataId, + label: 'Display Name', + iconName: 'profile', + type: 'FULL_NAME', + metadata: { + fieldName: 'displayName', + placeHolder: 'Mr Miagi', + }, +}; + +export const linkFieldDefinition: FieldDefinition = { + fieldMetadataId, + label: 'LinkedIn URL', + iconName: 'url', + type: 'LINK', + metadata: { + fieldName: 'linkedInURL', + placeHolder: 'https://linkedin.com/user', + }, +}; + +export const phoneFieldDefinition: FieldDefinition = { + fieldMetadataId, + label: 'Contact', + iconName: 'Phone', + type: 'TEXT', + metadata: { + objectMetadataNameSingular: 'person', + placeHolder: '(+256)-712-345-6789', + fieldName: 'phone', + }, +}; + +export const ratingfieldDefinition: FieldDefinition = { + fieldMetadataId, + label: 'Rating', + iconName: 'iconName', + type: 'RATING', + metadata: { + fieldName: 'rating', + }, +}; diff --git a/packages/twenty-front/src/modules/object-record/field/hooks/__tests__/useFieldInitialValue.test.tsx b/packages/twenty-front/src/modules/object-record/field/hooks/__tests__/useFieldInitialValue.test.tsx new file mode 100644 index 000000000..46d9131d4 --- /dev/null +++ b/packages/twenty-front/src/modules/object-record/field/hooks/__tests__/useFieldInitialValue.test.tsx @@ -0,0 +1,62 @@ +import { ReactNode } from 'react'; +import { act, renderHook } from '@testing-library/react'; +import { RecoilRoot, useSetRecoilState } from 'recoil'; + +import { + fieldMetadataId, + textfieldDefinition, +} from '@/object-record/field/__mocks__/fieldDefinitions'; +import { FieldContext } from '@/object-record/field/contexts/FieldContext'; +import { entityFieldInitialValueFamilyState } from '@/object-record/field/states/entityFieldInitialValueFamilyState'; + +import { useFieldInitialValue } from '../useFieldInitialValue'; + +const entityId = 'entityId'; + +const wrapper = ({ children }: { children: ReactNode }) => ( + + + {children} + + +); + +describe('useFieldInitialValue', () => { + it('should work as expected', () => { + const { result } = renderHook( + () => { + const setFieldInitialValue = useSetRecoilState( + entityFieldInitialValueFamilyState({ + fieldMetadataId, + entityId, + }), + ); + + return { + setFieldInitialValue, + fieldInitialValue: useFieldInitialValue(), + }; + }, + { + wrapper, + }, + ); + + expect(result.current.fieldInitialValue).toBeUndefined(); + + const initialValue = { isEmpty: false, value: 'Sheldon Cooper' }; + + act(() => { + result.current.setFieldInitialValue(initialValue); + }); + + expect(result.current.fieldInitialValue).toEqual(initialValue); + }); +}); diff --git a/packages/twenty-front/src/modules/object-record/field/hooks/__tests__/useGetButtonIcon.test.tsx b/packages/twenty-front/src/modules/object-record/field/hooks/__tests__/useGetButtonIcon.test.tsx new file mode 100644 index 000000000..7b5e711be --- /dev/null +++ b/packages/twenty-front/src/modules/object-record/field/hooks/__tests__/useGetButtonIcon.test.tsx @@ -0,0 +1,54 @@ +import { ReactNode } from 'react'; +import { renderHook } from '@testing-library/react'; +import { RecoilRoot } from 'recoil'; + +import { + phoneFieldDefinition, + relationFieldDefinition, +} from '@/object-record/field/__mocks__/fieldDefinitions'; +import { FieldContext } from '@/object-record/field/contexts/FieldContext'; +import { useGetButtonIcon } from '@/object-record/field/hooks/useGetButtonIcon'; +import { FieldDefinition } from '@/object-record/field/types/FieldDefinition'; +import { FieldMetadata } from '@/object-record/field/types/FieldMetadata'; +import { IconPencil } from '@/ui/display/icon'; + +const entityId = 'entityId'; + +const getWrapper = + (fieldDefinition: FieldDefinition) => + ({ children }: { children: ReactNode }) => ( + + {children} + + ); + +const PhoneWrapper = getWrapper(phoneFieldDefinition); +const RelationWrapper = getWrapper(relationFieldDefinition); + +describe('useGetButtonIcon', () => { + it('should return undefined', () => { + const { result } = renderHook(() => useGetButtonIcon()); + expect(result.current).toBeUndefined(); + }); + + it('should return icon pencil', () => { + const { result } = renderHook(() => useGetButtonIcon(), { + wrapper: PhoneWrapper, + }); + expect(result.current).toEqual(IconPencil); + }); + + it('should return iconPencil for relation field', () => { + const { result } = renderHook(() => useGetButtonIcon(), { + wrapper: RelationWrapper, + }); + expect(result.current).toEqual(IconPencil); + }); +}); diff --git a/packages/twenty-front/src/modules/object-record/field/hooks/__tests__/useIsFieldEditModeValueEmpty.test.tsx b/packages/twenty-front/src/modules/object-record/field/hooks/__tests__/useIsFieldEditModeValueEmpty.test.tsx new file mode 100644 index 000000000..ad359ae68 --- /dev/null +++ b/packages/twenty-front/src/modules/object-record/field/hooks/__tests__/useIsFieldEditModeValueEmpty.test.tsx @@ -0,0 +1,52 @@ +import { ReactNode } from 'react'; +import { act, renderHook } from '@testing-library/react'; +import { RecoilRoot, useSetRecoilState } from 'recoil'; + +import { phoneFieldDefinition } from '@/object-record/field/__mocks__/fieldDefinitions'; +import { FieldContext } from '@/object-record/field/contexts/FieldContext'; +import { useIsFieldEditModeValueEmpty } from '@/object-record/field/hooks/useIsFieldEditModeValueEmpty'; +import { entityFieldsEditModeValueFamilyState } from '@/object-record/field/states/entityFieldsEditModeValueFamilyState'; + +const entityId = 'entityId'; + +const Wrapper = ({ children }: { children: ReactNode }) => ( + + {children} + +); + +describe('useIsFieldEditModeValueEmpty', () => { + it('should work as expected', () => { + const { result } = renderHook( + () => { + const setFieldEditModeValue = useSetRecoilState( + entityFieldsEditModeValueFamilyState(entityId), + ); + return { + setFieldEditModeValue, + isFieldEditModeValueEmpty: useIsFieldEditModeValueEmpty(), + }; + }, + { + wrapper: Wrapper, + }, + ); + + expect(result.current.isFieldEditModeValueEmpty).toBe(true); + + act(() => { + result.current.setFieldEditModeValue({ + phone: '+1 233223', + }); + }); + + expect(result.current.isFieldEditModeValueEmpty).toBe(false); + }); +}); diff --git a/packages/twenty-front/src/modules/object-record/field/hooks/__tests__/useIsFieldEmpty.test.tsx b/packages/twenty-front/src/modules/object-record/field/hooks/__tests__/useIsFieldEmpty.test.tsx new file mode 100644 index 000000000..92e6c0bc8 --- /dev/null +++ b/packages/twenty-front/src/modules/object-record/field/hooks/__tests__/useIsFieldEmpty.test.tsx @@ -0,0 +1,53 @@ +import { ReactNode } from 'react'; +import { act, renderHook } from '@testing-library/react'; +import { RecoilRoot, useSetRecoilState } from 'recoil'; + +import { phoneFieldDefinition } from '@/object-record/field/__mocks__/fieldDefinitions'; +import { FieldContext } from '@/object-record/field/contexts/FieldContext'; +import { useIsFieldEmpty } from '@/object-record/field/hooks/useIsFieldEmpty'; +import { entityFieldsFamilyState } from '@/object-record/field/states/entityFieldsFamilyState'; + +const entityId = 'entityId'; + +const Wrapper = ({ children }: { children: ReactNode }) => ( + + {children} + +); + +describe('useIsFieldEmpty', () => { + it('should work as expected', () => { + const { result } = renderHook( + () => { + const setFieldState = useSetRecoilState( + entityFieldsFamilyState(entityId), + ); + return { + setFieldState, + isFieldEditModeValueEmpty: useIsFieldEmpty(), + }; + }, + { + wrapper: Wrapper, + }, + ); + + expect(result.current.isFieldEditModeValueEmpty).toBe(true); + + act(() => { + result.current.setFieldState({ + id: 'id', + phone: '+1 233223', + }); + }); + + expect(result.current.isFieldEditModeValueEmpty).toBe(false); + }); +}); diff --git a/packages/twenty-front/src/modules/object-record/field/hooks/__tests__/useIsFieldInputOnly.test.tsx b/packages/twenty-front/src/modules/object-record/field/hooks/__tests__/useIsFieldInputOnly.test.tsx new file mode 100644 index 000000000..a59a2b3fb --- /dev/null +++ b/packages/twenty-front/src/modules/object-record/field/hooks/__tests__/useIsFieldInputOnly.test.tsx @@ -0,0 +1,50 @@ +import { ReactNode } from 'react'; +import { renderHook } from '@testing-library/react'; +import { RecoilRoot } from 'recoil'; + +import { + phoneFieldDefinition, + ratingfieldDefinition, +} from '@/object-record/field/__mocks__/fieldDefinitions'; +import { FieldContext } from '@/object-record/field/contexts/FieldContext'; +import { useIsFieldInputOnly } from '@/object-record/field/hooks/useIsFieldInputOnly'; +import { FieldDefinition } from '@/object-record/field/types/FieldDefinition'; +import { FieldMetadata } from '@/object-record/field/types/FieldMetadata'; + +const entityId = 'entityId'; + +const getWrapper = + (fieldDefinition: FieldDefinition) => + ({ children }: { children: ReactNode }) => ( + + {children} + + ); + +const RatingWrapper = getWrapper(ratingfieldDefinition); +const PhoneWrapper = getWrapper(phoneFieldDefinition); + +describe('useIsFieldInputOnly', () => { + it('should return true', () => { + const { result } = renderHook(() => useIsFieldInputOnly(), { + wrapper: RatingWrapper, + }); + + expect(result.current).toBe(true); + }); + + it('should return false', () => { + const { result } = renderHook(() => useIsFieldInputOnly(), { + wrapper: PhoneWrapper, + }); + + expect(result.current).toBe(false); + }); +}); diff --git a/packages/twenty-front/src/modules/object-record/field/hooks/__tests__/usePersistField.test.tsx b/packages/twenty-front/src/modules/object-record/field/hooks/__tests__/usePersistField.test.tsx new file mode 100644 index 000000000..d3483ec55 --- /dev/null +++ b/packages/twenty-front/src/modules/object-record/field/hooks/__tests__/usePersistField.test.tsx @@ -0,0 +1,159 @@ +import { ReactNode } from 'react'; +import { gql } from '@apollo/client'; +import { MockedProvider, MockedResponse } from '@apollo/client/testing'; +import { act, renderHook, waitFor } from '@testing-library/react'; +import { RecoilRoot, useRecoilValue } from 'recoil'; + +import { CoreObjectNameSingular } from '@/object-metadata/types/CoreObjectNameSingular'; +import { + phoneFieldDefinition, + relationFieldDefinition, +} from '@/object-record/field/__mocks__/fieldDefinitions'; +import { + FieldContext, + RecordUpdateHook, + RecordUpdateHookParams, +} from '@/object-record/field/contexts/FieldContext'; +import { usePersistField } from '@/object-record/field/hooks/usePersistField'; +import { entityFieldsFamilySelector } from '@/object-record/field/states/selectors/entityFieldsFamilySelector'; +import { FieldDefinition } from '@/object-record/field/types/FieldDefinition'; +import { FieldMetadata } from '@/object-record/field/types/FieldMetadata'; +import { useUpdateOneRecord } from '@/object-record/hooks/useUpdateOneRecord'; + +jest.mock('@/object-metadata/hooks/useMapFieldMetadataToGraphQLQuery', () => ({ + useMapFieldMetadataToGraphQLQuery: () => () => '\n', +})); + +const query = gql` + mutation UpdateOneWorkspaceMember( + $idToUpdate: ID! + $input: WorkspaceMemberUpdateInput! + ) { + updateWorkspaceMember(id: $idToUpdate, data: $input) { + id + } + } +`; + +const mocks: MockedResponse[] = [ + { + request: { + query, + variables: { idToUpdate: 'entityId', input: { phone: '+1 123 456' } }, + }, + result: jest.fn(() => ({ + data: { + updateWorkspaceMember: { + id: 'entityId', + }, + }, + })), + }, + { + request: { + query, + variables: { + idToUpdate: 'entityId', + input: { contactId: null, contact: { foo: 'bar' } }, + }, + }, + result: jest.fn(() => ({ + data: { + updateWorkspaceMember: { + id: 'entityId', + }, + }, + })), + }, +]; + +const entityId = 'entityId'; +const fieldName = 'phone'; + +const getWrapper = + (fieldDefinition: FieldDefinition) => + ({ children }: { children: ReactNode }) => { + const useUpdateOneRecordMutation: RecordUpdateHook = () => { + const { updateOneRecord } = useUpdateOneRecord({ + objectNameSingular: CoreObjectNameSingular.WorkspaceMember, + }); + + const updateEntity = ({ variables }: RecordUpdateHookParams) => { + updateOneRecord?.({ + idToUpdate: variables.where.id as string, + updateOneRecordInput: variables.updateOneRecordInput, + }); + }; + + return [updateEntity, { loading: false }]; + }; + + return ( + + + {children} + + + ); + }; + +const PhoneWrapper = getWrapper(phoneFieldDefinition); +const RelationWrapper = getWrapper(relationFieldDefinition); + +describe('usePersistField', () => { + it('should work as expected', async () => { + const { result } = renderHook( + () => { + const entityFields = useRecoilValue( + entityFieldsFamilySelector({ entityId, fieldName }), + ); + + return { + persistField: usePersistField(), + entityFields, + }; + }, + { wrapper: PhoneWrapper }, + ); + + act(() => { + result.current.persistField('+1 123 456'); + }); + + await waitFor(() => { + expect(mocks[0].result).toHaveBeenCalled(); + }); + }); + + it('should persist relation field', async () => { + const { result } = renderHook( + () => { + const entityFields = useRecoilValue( + entityFieldsFamilySelector({ entityId, fieldName }), + ); + + return { + persistField: usePersistField(), + entityFields, + }; + }, + { wrapper: RelationWrapper }, + ); + + act(() => { + result.current.persistField({ foo: 'bar' }); + }); + + await waitFor(() => { + expect(mocks[1].result).toHaveBeenCalled(); + }); + }); +}); diff --git a/packages/twenty-front/src/modules/object-record/field/hooks/__tests__/useSaveFieldEditModeValue.test.tsx b/packages/twenty-front/src/modules/object-record/field/hooks/__tests__/useSaveFieldEditModeValue.test.tsx new file mode 100644 index 000000000..4b972f6f7 --- /dev/null +++ b/packages/twenty-front/src/modules/object-record/field/hooks/__tests__/useSaveFieldEditModeValue.test.tsx @@ -0,0 +1,57 @@ +import { ReactNode } from 'react'; +import { MockedProvider } from '@apollo/client/testing'; +import { act, renderHook } from '@testing-library/react'; +import { RecoilRoot, useRecoilValue } from 'recoil'; + +import { phoneFieldDefinition } from '@/object-record/field/__mocks__/fieldDefinitions'; +import { FieldContext } from '@/object-record/field/contexts/FieldContext'; +import { useSaveFieldEditModeValue } from '@/object-record/field/hooks/useSaveFieldEditModeValue'; +import { entityFieldsEditModeValueFamilySelector } from '@/object-record/field/states/selectors/entityFieldsEditModeValueFamilySelector'; + +const entityId = 'entityId'; +const fieldName = 'phone'; + +const Wrapper = ({ children }: { children: ReactNode }) => { + return ( + + + {children} + + + ); +}; + +describe('useSaveFieldEditModeValue', () => { + it('should work as expected', () => { + const { + result: { current }, + } = renderHook( + () => { + const entityFieldsEditModeValue = useRecoilValue( + entityFieldsEditModeValueFamilySelector({ entityId, fieldName }), + ); + return { + saveFieldEditModeValue: useSaveFieldEditModeValue(), + entityFieldsEditModeValue, + }; + }, + { wrapper: Wrapper }, + ); + + expect(current.entityFieldsEditModeValue).toBeUndefined(); + + act(() => { + current.saveFieldEditModeValue('test'); + }); + + // We expect `current.entityFieldsEditModeValue` to be updated + // but I think it's async + }); +}); diff --git a/packages/twenty-front/src/modules/object-record/field/hooks/__tests__/useToggleEditOnlyInput.test.tsx b/packages/twenty-front/src/modules/object-record/field/hooks/__tests__/useToggleEditOnlyInput.test.tsx new file mode 100644 index 000000000..3bbd662d9 --- /dev/null +++ b/packages/twenty-front/src/modules/object-record/field/hooks/__tests__/useToggleEditOnlyInput.test.tsx @@ -0,0 +1,95 @@ +import { ReactNode } from 'react'; +import { gql } from '@apollo/client'; +import { MockedProvider, MockedResponse } from '@apollo/client/testing'; +import { act, renderHook, waitFor } from '@testing-library/react'; +import { RecoilRoot } from 'recoil'; + +import { CoreObjectNameSingular } from '@/object-metadata/types/CoreObjectNameSingular'; +import { booleanFieldDefinition } from '@/object-record/field/__mocks__/fieldDefinitions'; +import { + FieldContext, + RecordUpdateHook, + RecordUpdateHookParams, +} from '@/object-record/field/contexts/FieldContext'; +import { useToggleEditOnlyInput } from '@/object-record/field/hooks/useToggleEditOnlyInput'; +import { useUpdateOneRecord } from '@/object-record/hooks/useUpdateOneRecord'; + +jest.mock('@/object-metadata/hooks/useMapFieldMetadataToGraphQLQuery', () => ({ + useMapFieldMetadataToGraphQLQuery: () => () => '\n', +})); + +const entityId = 'entityId'; + +const mocks: MockedResponse[] = [ + { + request: { + query: gql` + mutation UpdateOnePerson($idToUpdate: ID!, $input: PersonUpdateInput!) { + updatePerson(id: $idToUpdate, data: $input) { + id + } + } + `, + variables: { idToUpdate: 'entityId', input: { isActive: true } }, + }, + result: jest.fn(() => ({ + data: { + updateWorkspaceMember: { + id: 'entityId', + }, + }, + })), + }, +]; + +const Wrapper = ({ children }: { children: ReactNode }) => { + const useUpdateOneRecordMutation: RecordUpdateHook = () => { + const { updateOneRecord } = useUpdateOneRecord({ + objectNameSingular: CoreObjectNameSingular.Person, + }); + + const updateEntity = ({ variables }: RecordUpdateHookParams) => { + updateOneRecord?.({ + idToUpdate: variables.where.id as string, + updateOneRecordInput: variables.updateOneRecordInput, + }); + }; + + return [updateEntity, { loading: false }]; + }; + + return ( + + + {children} + + + ); +}; + +describe('useToggleEditOnlyInput', () => { + it('should toggle field', async () => { + const { result } = renderHook( + () => ({ toggleField: useToggleEditOnlyInput() }), + { + wrapper: Wrapper, + }, + ); + + act(() => { + result.current.toggleField(); + }); + + await waitFor(() => { + expect(mocks[0].result).toHaveBeenCalled(); + }); + }); +}); diff --git a/packages/twenty-front/src/modules/object-record/field/utils/__tests__/isFieldValueEmpty.test.ts b/packages/twenty-front/src/modules/object-record/field/utils/__tests__/isFieldValueEmpty.test.ts new file mode 100644 index 000000000..205fdbc06 --- /dev/null +++ b/packages/twenty-front/src/modules/object-record/field/utils/__tests__/isFieldValueEmpty.test.ts @@ -0,0 +1,118 @@ +import { + booleanFieldDefinition, + fieldMetadataId, + fullNameFieldDefinition, + linkFieldDefinition, + relationFieldDefinition, + selectFieldDefinition, +} from '@/object-record/field/__mocks__/fieldDefinitions'; +import { FieldDefinition } from '@/object-record/field/types/FieldDefinition'; +import { FieldCurrencyMetadata } from '@/object-record/field/types/FieldMetadata'; + +import { isFieldValueEmpty } from '../isFieldValueEmpty'; + +describe('isFieldValueEmpty', () => { + it('should return correct value for boolean field', () => { + expect( + isFieldValueEmpty({ + fieldDefinition: booleanFieldDefinition, + fieldValue: null, + }), + ).toBe(true); + expect( + isFieldValueEmpty({ + fieldDefinition: booleanFieldDefinition, + fieldValue: false, + }), + ).toBe(false); + expect( + isFieldValueEmpty({ + fieldDefinition: booleanFieldDefinition, + fieldValue: true, + }), + ).toBe(false); + }); + + it('should return correct value for relation field', () => { + expect( + isFieldValueEmpty({ + fieldDefinition: relationFieldDefinition, + fieldValue: null, + }), + ).toBe(true); + expect( + isFieldValueEmpty({ + fieldDefinition: relationFieldDefinition, + fieldValue: { foo: 'bar' }, + }), + ).toBe(false); + }); + + it('should return correct value for select field', () => { + // If the value does not match the fieldDefinition, it will always return `false` + // Should it return `false` or `true` if the fieldValue doesn't match? + expect( + isFieldValueEmpty({ + fieldDefinition: selectFieldDefinition, + fieldValue: '', + }), + ).toBe(false); + }); + + it('should return correct value for currency field', () => { + const fieldDefinition: FieldDefinition = { + fieldMetadataId, + label: 'Annual Income', + iconName: 'cashCow', + type: 'CURRENCY', + metadata: { + fieldName: 'annualIncome', + placeHolder: '100000', + isPositive: true, + }, + }; + + expect( + isFieldValueEmpty({ + fieldDefinition, + fieldValue: { currencyCode: 'USD', amountMicros: 1000000 }, + }), + ).toBe(false); + expect( + isFieldValueEmpty({ + fieldDefinition, + fieldValue: { currencyCode: 'USD' }, + }), + ).toBe(true); + }); + + it('should return correct value for fullname field', () => { + expect( + isFieldValueEmpty({ + fieldDefinition: fullNameFieldDefinition, + fieldValue: { firstName: '', lastName: '' }, + }), + ).toBe(true); + expect( + isFieldValueEmpty({ + fieldDefinition: fullNameFieldDefinition, + fieldValue: { firstName: 'Sheldon', lastName: '' }, + }), + ).toBe(false); + }); + + it('should return correct value for link field', () => { + expect( + isFieldValueEmpty({ + fieldDefinition: linkFieldDefinition, + fieldValue: { url: '', label: '' }, + }), + ).toBe(true); + expect( + isFieldValueEmpty({ + fieldDefinition: linkFieldDefinition, + fieldValue: { url: 'https://linkedin.com/user-slug', label: '' }, + }), + ).toBe(false); + }); +});