Skip to content

Commit 1ab1ef5

Browse files
authored
fix: resolve flaky timestamp comparison in holder repository test (#681)
Signed-off-by: Miguel_LZPF <[email protected]>
1 parent 3dfa967 commit 1ab1ef5

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

apps/mass-payout/backend/test/integration/adapters/repositories/typeorm-holder.repository.spec.ts

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -298,8 +298,22 @@ describe(HolderTypeOrmRepository.name, () => {
298298
const savedHolders = await holderRepository.saveHolders(holders)
299299

300300
expect(savedHolders).toHaveLength(2)
301-
expect(savedHolders).toContainEqual(holder1)
302-
expect(savedHolders).toContainEqual(holder2)
301+
302+
const savedHolder1 = savedHolders.find((h) => h.id === holder1.id)
303+
const savedHolder2 = savedHolders.find((h) => h.id === holder2.id)
304+
305+
expect(savedHolder1).toMatchObject({
306+
id: holder1.id,
307+
holderEvmAddress: holder1.holderEvmAddress,
308+
holderHederaAddress: holder1.holderHederaAddress,
309+
status: holder1.status,
310+
})
311+
expect(savedHolder2).toMatchObject({
312+
id: holder2.id,
313+
holderEvmAddress: holder2.holderEvmAddress,
314+
holderHederaAddress: holder2.holderHederaAddress,
315+
status: holder2.status,
316+
})
303317
})
304318

305319
it("should throw HolderRepositoryError when saving multiple holders fails", async () => {

0 commit comments

Comments
 (0)