Skip to content

Commit 176e317

Browse files
committed
test: add falsy step case
1 parent 6ba38fd commit 176e317

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

test/useWizard.test.tsx

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,20 @@ describe('useWizard', () => {
3838
expect(result.current.stepCount).toBe(2);
3939
});
4040

41+
test('should set step count to one when using falsy step', () => {
42+
const { result } = renderHook(() => useWizard(), {
43+
wrapper: ({ children }) => (
44+
<Wizard>
45+
<p>step 1 {children}</p>
46+
<p>step 2 {children}</p>
47+
{false && <p>step 3 {children}</p>}
48+
</Wizard>
49+
),
50+
});
51+
52+
expect(result.current.stepCount).toBe(2);
53+
});
54+
4155
test('should set active step to one', () => {
4256
const { result } = renderUseWizardHook(1);
4357

0 commit comments

Comments
 (0)