From 91acf5d6b3b4299e55a470c62094c5749eb93a5c Mon Sep 17 00:00:00 2001 From: evgeny Date: Wed, 25 Oct 2023 17:40:38 +0100 Subject: [PATCH] fix: useCursors test with newest ably-js --- src/react/useCursors.test.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/react/useCursors.test.tsx b/src/react/useCursors.test.tsx index b7020e33..8337b7e3 100644 --- a/src/react/useCursors.test.tsx +++ b/src/react/useCursors.test.tsx @@ -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'; @@ -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({