From 74267d480a917add1fba83dea79b83505c0ac0bd Mon Sep 17 00:00:00 2001 From: resolritter Date: Tue, 22 Sep 2020 01:29:26 -0300 Subject: [PATCH] fix coding style and improve test documentation --- src/index.test.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/index.test.js b/src/index.test.js index 11984c8..99911c8 100644 --- a/src/index.test.js +++ b/src/index.test.js @@ -152,17 +152,17 @@ describe('Step Wizard Component', () => { )); - }) + }); it('renders dynamic trees from mapped collections', () => { - const data = [1,2,3,4] + const data = [1, 2, 3, 4]; const { instance } = testComponent(( - {data.map((i) =>
{i}
)} + {data.map((i) =>
{i}
)}
)); - expect(instance.totalSteps).toBe(data.length) - }) + expect(instance.totalSteps).toBe(data.length); + }); it('garbage props', () => { console.error.mockClear(); @@ -197,7 +197,8 @@ describe('Step Wizard Functions', () => { {null} - )) + )); + // only non-null children are kept, i.e. 1. Step1 and 2. Step2 expect(wrapper.totalSteps).toEqual(2); // first child is null, thus it should've been pruned and we should be at expect(wrapper.state.activeStep).toEqual(0);