Skip to content

Commit

Permalink
fix: useCursors test with newest ably-js
Browse files Browse the repository at this point in the history
  • Loading branch information
ttypic authored and dpiatek committed Nov 20, 2023
1 parent 946b49c commit 91acf5d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/react/useCursors.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import React from 'react';
import { Realtime } from 'ably/promises';
import { it, beforeEach, describe, expect, vi } from 'vitest';
import { waitFor, renderHook } from '@testing-library/react';
import { waitFor, renderHook, act } from '@testing-library/react';
import { SpacesProvider } from './contexts/SpacesContext.js';
import { SpaceProvider } from './contexts/SpaceContext.js';
import Spaces from '../index.js';
Expand Down Expand Up @@ -114,7 +114,9 @@ describe('useCursors', () => {
data: [{ cursor: { position: { x: 1, y: 1 } } }],
};

dispensing.processBatch(fakeMessage);
await act(() => {
dispensing.processBatch(fakeMessage);
});

await waitFor(() => {
expect(result.current.cursors).toEqual({
Expand Down

0 comments on commit 91acf5d

Please sign in to comment.