Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -742,7 +742,7 @@ describe('useEffectEvent', () => {
await act(() =>
ReactNoop.render(<ChatRoom roomId="general" theme="light" />),
);
await act(() => jest.runAllTimers());

assertLog(['Welcome to the general room!', 'Connected! theme: light']);
expect(ReactNoop).toMatchRenderedOutput(
<span prop="Welcome to the general room!" />,
Expand All @@ -752,20 +752,17 @@ describe('useEffectEvent', () => {
await act(() =>
ReactNoop.render(<ChatRoom roomId="music" theme="light" />),
);
await act(() => jest.runAllTimers());
assertLog([
'Welcome to the music room!',
// should trigger a reconnect
'Connected! theme: light',
]);

expect(ReactNoop).toMatchRenderedOutput(
<span prop="Welcome to the music room!" />,
);

// change theme only
await act(() => ReactNoop.render(<ChatRoom roomId="music" theme="dark" />));
await act(() => jest.runAllTimers());
// should not trigger a reconnect
assertLog(['Welcome to the music room!']);
expect(ReactNoop).toMatchRenderedOutput(
Expand All @@ -776,7 +773,6 @@ describe('useEffectEvent', () => {
await act(() =>
ReactNoop.render(<ChatRoom roomId="travel" theme="dark" />),
);
await act(() => jest.runAllTimers());
assertLog([
'Welcome to the travel room!',
// should trigger a reconnect
Expand Down