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
6 changes: 3 additions & 3 deletions apps/meteor/client/hooks/usePruneWarningMessage.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { IRoomWithRetentionPolicy } from '@rocket.chat/core-typings';
import { renderHook } from '@testing-library/react';
import { renderHook, waitFor } from '@testing-library/react';

import { usePruneWarningMessage } from './usePruneWarningMessage';
import { createRenteionPolicySettingsMock as createMock } from '../../tests/mocks/client/mockRetentionPolicySettings';
Expand Down Expand Up @@ -40,8 +40,8 @@ describe('usePruneWarningMessage hook', () => {
}),
});
expect(result.current).toEqual('a minute June 1, 2024 at 12:30 AM');
jest.advanceTimersByTime(31 * 60 * 1000);
expect(result.current).toEqual('a minute June 1, 2024 at 1:00 AM');
await jest.advanceTimersByTimeAsync(31 * 60 * 1000);
await waitFor(() => expect(result.current).toEqual('a minute June 1, 2024 at 1:00 AM'));
});

it('Should return the default warning with precision set to every_hour', () => {
Expand Down
Loading