diff --git a/package.json b/package.json index 3217668c05e2df754729f7994a7a71202af1b9ca..1f28697d3c82c2e773b0d9fb14db0cb5d9c5f8f0 100644 --- a/package.json +++ b/package.json @@ -45,7 +45,7 @@ }, "jest": { "moduleNameMapper": { - "\\.css$": "<rootDir>/test/setup/styleMock.js" + "\\.s?css$": "<rootDir>/test/setup/styleMock.js" }, "transform": { "\\.js$": "<rootDir>/test/config/transform.js" diff --git a/test/AppBar.test.js b/test/AppBar.test.js index b0cc4289d9931953455d9f228f0170d244ef84b6..cefb04773e17917acf16a5344b1d83f30763be25 100644 --- a/test/AppBar.test.js +++ b/test/AppBar.test.js @@ -80,7 +80,7 @@ describe('AppBar', () => { expect(rightArea.children()).toHaveLength(2) const userName = rightArea.childAt(0) - expect(userName.text()).toBe(props.userName) + expect(userName.text()).toBe("<Icon />some name") }) test('Should display the login link if no username is given', () => { diff --git a/test/Radio.test.js b/test/Radio.test.js index a548f014a4ceb6c05e3bf08a28f01cad765c1899..ceae22df240e1783ccb2c0658f4936e078992320 100644 --- a/test/Radio.test.js +++ b/test/Radio.test.js @@ -30,9 +30,9 @@ describe('Radio', () => { expect(input.is('input')).toBeTruthy() expect(input.children()).toHaveLength(0) - const labelText = wrapper.childAt(1) - expect(labelText.text()).toBe(props.label) - expect(labelText.children()).toHaveLength(0) + const labelSpan = wrapper.childAt(1) + expect(labelSpan.text()).toBe(props.label) + expect(labelSpan.children()).toHaveLength(1) }) test('Input gets the correct props', () => { diff --git a/test/__snapshots__/AppBar.test.js.snap b/test/__snapshots__/AppBar.test.js.snap index 3ea9dd76f9ae3d4ecc47f49421e686b39b85b30f..456909a198402833ec60fb07962c084c4ad62692 100644 --- a/test/__snapshots__/AppBar.test.js.snap +++ b/test/__snapshots__/AppBar.test.js.snap @@ -5,7 +5,7 @@ exports[`AppBar Snapshot 1`] = ` className={undefined} > <a - className={undefined} + className="" onClick={[Function]} style={Object {}} > @@ -15,7 +15,38 @@ exports[`AppBar Snapshot 1`] = ` <span className={undefined} > - some name + <span> + <svg + height={16} + viewBox="0 0 24 24" + width={16} + xmlns="http://www.w3.org/2000/svg" + > + <path + d="M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2" + fill="none" + stroke="black" + strokeLinecap="round" + strokeLinejoin="round" + strokeWidth="2" + /> + <circle + cx="12" + cy="7" + fill="none" + r="4" + stroke="black" + strokeLinecap="round" + strokeLinejoin="round" + strokeWidth="2" + /> + </svg> + </span> + <span + className={undefined} + > + some name + </span> </span> <a className="" diff --git a/test/__snapshots__/Menu.test.js.snap b/test/__snapshots__/Menu.test.js.snap index 1f56dbdc0d191a028db551d5dc9086012ead179f..0d6d7d32193a6a59ba062d7313884f2c25001d81 100644 --- a/test/__snapshots__/Menu.test.js.snap +++ b/test/__snapshots__/Menu.test.js.snap @@ -2,12 +2,15 @@ exports[`Menu Snapshot 1`] = ` <div - className={undefined} + className="" > - <div> + <div + className={undefined} + > <button className={undefined} onClick={[Function]} + type="button" > <span> Foo diff --git a/test/__snapshots__/Radio.test.js.snap b/test/__snapshots__/Radio.test.js.snap index f93d4bcaef0e4a65d160aa6e70a632276acba0d4..22221e98a81999c5110a0454a82e70c78d6b54f9 100644 --- a/test/__snapshots__/Radio.test.js.snap +++ b/test/__snapshots__/Radio.test.js.snap @@ -2,16 +2,26 @@ exports[`Radio Snapshot 1`] = ` <label - className={undefined} + className="" + style={ + Object { + "color": undefined, + } + } > <input checked={false} className={undefined} name="TestName" + onChange={undefined} required={true} type="radio" value="TestValue" /> - TestLabel + <span + className={undefined} + > + TestLabel + </span> </label> `; diff --git a/test/__snapshots__/RadioGroup.test.js.snap b/test/__snapshots__/RadioGroup.test.js.snap index edbf58540e8de5ee84044dcb17bf844b21582150..7060ef82c0a7cf3f46dc178940cdcc45388a247c 100644 --- a/test/__snapshots__/RadioGroup.test.js.snap +++ b/test/__snapshots__/RadioGroup.test.js.snap @@ -3,43 +3,73 @@ exports[`Radio Group Snapshot 1`] = ` <div> <label - className={undefined} + className="" + style={ + Object { + "color": undefined, + } + } > <input checked={false} className={undefined} name="TestName" + onChange={[Function]} required={true} type="radio" value="yes" /> - Yes + <span + className={undefined} + > + Yes + </span> </label> <label - className={undefined} + className="" + style={ + Object { + "color": undefined, + } + } > <input checked={false} className={undefined} name="TestName" + onChange={[Function]} required={true} type="radio" value="no" /> - No + <span + className={undefined} + > + No + </span> </label> <label - className={undefined} + className="" + style={ + Object { + "color": undefined, + } + } > <input checked={false} className={undefined} name="TestName" + onChange={[Function]} required={true} type="radio" value="maybe" /> - Maybe + <span + className={undefined} + > + Maybe + </span> </label> </div> `; diff --git a/test/__snapshots__/YesOrNo.test.js.snap b/test/__snapshots__/YesOrNo.test.js.snap index bce7baa1ac46c64450248bdfd4ef65e8509baf92..11ea90396ab9bf1f32299ddf600de8691e8f4340 100644 --- a/test/__snapshots__/YesOrNo.test.js.snap +++ b/test/__snapshots__/YesOrNo.test.js.snap @@ -3,30 +3,50 @@ exports[`Yes or No Snapshot 1`] = ` <div> <label - className={undefined} + className="" + style={ + Object { + "color": undefined, + } + } > <input checked={false} className={undefined} name="TestName" + onChange={[Function]} required={undefined} type="radio" value="yes" /> - Yes + <span + className={undefined} + > + Yes + </span> </label> <label - className={undefined} + className="" + style={ + Object { + "color": undefined, + } + } > <input checked={false} className={undefined} name="TestName" + onChange={[Function]} required={undefined} type="radio" value="no" /> - No + <span + className={undefined} + > + No + </span> </label> </div> `;