We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f1fdcd0 commit b5995ddCopy full SHA for b5995dd
app/tests/src/hooks/useAppUpdates.test.ts
@@ -46,15 +46,24 @@ describe('useAppUpdates', () => {
46
});
47
48
49
- it('shows modal when triggered', () => {
+ it('shows modal when triggered', async () => {
50
(checkVersion as jest.Mock).mockResolvedValue({
51
needsUpdate: true,
52
url: 'u',
53
54
+
55
const { result } = renderHook(() => useAppUpdates());
56
57
+ // Wait for the async checkVersion to complete first
58
+ await waitFor(() => {
59
+ expect(result.current[0]).toBe(true);
60
+ });
61
62
+ // Now test the modal trigger
63
act(() => {
64
result.current[1]();
65
66
67
expect(registerModalCallbacks).toHaveBeenCalled();
68
expect(navigate).toHaveBeenCalledWith('Modal', expect.any(Object));
69
0 commit comments