diff --git a/packages/framework/esm-framework/mock.tsx b/packages/framework/esm-framework/mock.tsx index d6b5149fd..c490e89ee 100644 --- a/packages/framework/esm-framework/mock.tsx +++ b/packages/framework/esm-framework/mock.tsx @@ -1,9 +1,9 @@ import React from 'react'; import type {} from '@openmrs/esm-globals'; -import { createStore, StoreApi } from 'zustand'; +import { createStore, type StoreApi } from 'zustand'; import { NEVER, of } from 'rxjs'; import { interpolateUrl } from '@openmrs/esm-config'; -import { SessionStore } from '@openmrs/esm-api'; +import { type SessionStore } from '@openmrs/esm-api'; export { parseDate, formatDate, formatDatetime, formatTime, age } from '@openmrs/esm-utils'; export { interpolateString, interpolateUrl, validators, validator } from '@openmrs/esm-config'; @@ -56,6 +56,16 @@ export const newWorkspaceItem = jest.fn(); export const fhirBaseUrl = '/ws/fhir2/R4'; +export const attachmentUrl = '/ws/rest/v1/attachment'; + +export const getAttachmentByUuid = jest.fn(); + +export const getAttachments = jest.fn(); + +export const createAttachment = jest.fn(); + +export const deleteAttachmentPermanently = jest.fn(); + /* esm-state */ interface StoreEntity { value: StoreApi; @@ -205,6 +215,14 @@ export const ComponentContext = React.createContext(null); export const openmrsComponentDecorator = jest.fn().mockImplementation(() => (component) => component); +export const useAttachments = jest.fn(() => ({ + isLoading: true, + data: [], + error: null, + mutate: jest.fn(), + isValidating: true, +})); + export const useCurrentPatient = jest.fn(() => []); export const usePatient = jest.fn(() => ({