From df06cc125a20ff3f275ce65351c5fc38f1edadb5 Mon Sep 17 00:00:00 2001 From: Jody LeCompte Date: Sat, 6 Oct 2018 12:48:10 -0500 Subject: [PATCH] Increase test coverage Additional test cases added to Wizard Component - Ensuring that the component does not attempt to render without children - Does not render future steps until needed --- tests/index-test.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/tests/index-test.js b/tests/index-test.js index 3912024..78a1e10 100644 --- a/tests/index-test.js +++ b/tests/index-test.js @@ -20,4 +20,22 @@ describe('Wizard', () => { expect(node.innerHTML).toContain('React-Wizard') }) }) + + it('does not render without children', () => { + render(, node, () => { + expect(node.children.length).toBe(0); + }) + }) + + it('does not render future steps', () => { + const structure = ( + + {() =>

>@rahsheen/React-Wizard

}
+ {() =>

Step 2

}
+
+ ) + render(structure, node, () => { + expect(node.innerHTML).toNotContain('Step 2'); + }) + }) })