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
3 changes: 3 additions & 0 deletions tests/unit/pages/inbox/ConciergeDraftContext.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,8 @@ describe('ConciergeDraftContext', () => {
});

it('does not apply completed final HTML until the paced Pusher target is fully visible', async () => {
let now = 1000;
jest.spyOn(Date, 'now').mockImplementation(() => now);
const wrapper = ({children}: PropsWithChildren) => <ConciergeDraftProvider reportID={REPORT_ID}>{children}</ConciergeDraftProvider>;
const {result, unmount} = renderHook(() => useConciergeDraft(), {wrapper});

Expand All @@ -168,6 +170,7 @@ describe('ConciergeDraftContext', () => {
expect(getFirstMessageText(result.current.draftReportAction)).toBe('H');

// When completion arrives before the visible body reaches the target
now += PUSHER_DRAFT_PACE_INTERVAL_MS;
act(() => {
emitPusherEvent(
Pusher.TYPE.CONCIERGE_DRAFT_COMPLETED,
Expand Down
Loading