Skip to content

Commit f6fa649

Browse files
committed
chore: ensure no warnings are logged when items and children are valid
1 parent 3efbc1c commit f6fa649

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,4 @@ storybook-static
2828

2929
.eslintcache
3030
coverage/
31+
.scannerwork

lib/hooks/useValidateChildren.test.tsx

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@ describe('useValidateChildren', () => {
3030

3131
act(() => renderHook(() => useValidateChildren({ items, children: null })));
3232

33-
expect(warnSpy).not.toHaveBeenCalled();
33+
await waitFor(() => {
34+
expect(warnSpy).toHaveBeenCalledTimes(0);
35+
});
3436
});
3537

3638
it('should not log warnings when NavItems and ContentSections match', async () => {
@@ -49,7 +51,9 @@ describe('useValidateChildren', () => {
4951

5052
act(() => renderHook(() => useValidateChildren({ children, items: undefined })));
5153

52-
expect(warnSpy).not.toHaveBeenCalled();
54+
await waitFor(() => {
55+
expect(warnSpy).toHaveBeenCalledTimes(0);
56+
});
5357
});
5458

5559
it('should log warnings for missing ContentSections', async () => {
@@ -123,6 +127,8 @@ describe('useValidateChildren', () => {
123127

124128
act(() => renderHook(() => useValidateChildren({ children, items: undefined })));
125129

126-
expect(warnSpy).not.toHaveBeenCalled();
130+
await waitFor(() => {
131+
expect(warnSpy).toHaveBeenCalledTimes(0);
132+
});
127133
});
128134
});

0 commit comments

Comments
 (0)