-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bf73b7e
commit cb987a0
Showing
12 changed files
with
101 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { useContext } from 'react'; | ||
import { ServicesContext } from '@src/contexts'; | ||
|
||
export const useServicesContext = () => { | ||
return useContext(ServicesContext); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
54 changes: 54 additions & 0 deletions
54
src/test/__mocks__/common/hooks/useServicesContext.mock.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
export const userValuesService = { | ||
set: jest.fn(), | ||
setValue: jest.fn(), | ||
getAllValues: jest.fn(), | ||
getValue: jest.fn(), | ||
} as unknown as IUserValuesService; | ||
|
||
export const selectedEntriesService = { | ||
get: jest.fn(), | ||
set: jest.fn(), | ||
addNew: jest.fn(), | ||
addDuplicated: jest.fn(), | ||
remove: jest.fn(), | ||
} as unknown as ISelectedEntriesService; | ||
|
||
export const schemaWithDuplicatesService = { | ||
get: jest.fn(), | ||
set: jest.fn(), | ||
duplicateEntry: jest.fn(), | ||
} as unknown as ISchemaWithDuplicatesService; | ||
|
||
export const lookupCacheService = { | ||
save: jest.fn(), | ||
getAll: jest.fn(), | ||
getById: jest.fn(), | ||
} as unknown as ILookupCacheService; | ||
|
||
export const recordNormalizingService = { | ||
init: jest.fn(), | ||
get: jest.fn(), | ||
} as IRecordNormalizingService; | ||
|
||
export const recordToSchemaMappingService = { | ||
init: jest.fn(), | ||
get: jest.fn(), | ||
} as IRecordToSchemaMappingService; | ||
|
||
export const schemaCreatorService = { | ||
init: jest.fn(), | ||
get: jest.fn(), | ||
generate: jest.fn(), | ||
} as ISchemaService; | ||
|
||
jest.mock('@common/hooks/useServicesContext.ts', () => ({ | ||
useServicesContext: () => ({ | ||
userValuesService, | ||
selectedEntriesService, | ||
schemaWithDuplicatesService, | ||
lookupCacheService, | ||
recordNormalizingService, | ||
recordToSchemaMappingService, | ||
schemaCreatorService, | ||
}), | ||
})); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters