diff --git a/sdk/src/dataMapper/PortalDataMapper.test.ts b/sdk/src/dataMapper/PortalDataMapper.test.ts index d97d6fb2..d3539669 100644 --- a/sdk/src/dataMapper/PortalDataMapper.test.ts +++ b/sdk/src/dataMapper/PortalDataMapper.test.ts @@ -20,11 +20,21 @@ describe("PortalDataMapper", () => { attestationRegistryAddress: "0x4", }; const mockWeb3Client = {} as PublicClient; - const mockVeraxSdk = {} as VeraxSdk; const mockWalletClient = {} as WalletClient; + const mockVeraxSdk = { + schema: { + findOneById: jest.fn(), + }, + } as unknown as VeraxSdk; beforeEach(() => { portalDataMapper = new PortalDataMapper(mockConf, mockWeb3Client, mockVeraxSdk, mockWalletClient); + + // Setup a default mock return value for findOneById + (mockVeraxSdk.schema.findOneById as jest.Mock).mockResolvedValue({ + id: "123", + name: "Sample Schema", + }); }); afterEach(() => { diff --git a/sdk/src/dataMapper/PortalDataMapper.ts b/sdk/src/dataMapper/PortalDataMapper.ts index 3af7a5e2..62ee378d 100644 --- a/sdk/src/dataMapper/PortalDataMapper.ts +++ b/sdk/src/dataMapper/PortalDataMapper.ts @@ -27,6 +27,7 @@ export default class PortalDataMapper extends BaseDataMapper