Skip to content

Commit

Permalink
timer fix
Browse files Browse the repository at this point in the history
  • Loading branch information
hardyjosh committed Feb 14, 2025
1 parent 16d4354 commit a140ab0
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion packages/ui-components/src/__tests__/transactionStore.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -236,8 +236,12 @@ describe('transactionStore', () => {

(getTransaction as Mock).mockResolvedValue({ id: mockTxHash });

vi.useFakeTimers({ shouldAdvanceTime: true });

await awaitTransactionIndexing(mockSubgraphUrl, mockTxHash, mockSuccessMessage);

vi.runOnlyPendingTimers();

await waitFor(() => {
expect(get(transactionStore).status).toBe(TransactionStatus.SUCCESS);
expect(get(transactionStore).message).toBe(mockSuccessMessage);
Expand All @@ -253,7 +257,11 @@ describe('transactionStore', () => {

(getTransaction as Mock).mockResolvedValue(null);

const indexingPromise = awaitTransactionIndexing(mockSubgraphUrl, mockTxHash, mockSuccessMessage);
const indexingPromise = awaitTransactionIndexing(
mockSubgraphUrl,
mockTxHash,
mockSuccessMessage
);

expect(get(transactionStore).status).toBe(TransactionStatus.PENDING_SUBGRAPH);
expect(get(transactionStore).message).toBe('Checking for transaction indexing...');
Expand Down

0 comments on commit a140ab0

Please sign in to comment.