forked from BolajiOlajide/a_socials
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
309 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
module.exports = 'test-file-stub'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
module.exports = {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import React from 'react'; | ||
import { shallow } from 'enzyme'; | ||
import { Avatar } from '../../component/Avatar'; | ||
|
||
describe('Avatar Component', () => { | ||
it('should render correctly', () => { | ||
const props = { | ||
imgUrl: '//http:/img.jpg' | ||
}; | ||
|
||
const wrapper = shallow(<Avatar {...props} />); | ||
|
||
expect(wrapper).toMatchSnapshot(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import React from 'react'; | ||
import { shallow } from 'enzyme'; | ||
import { AvatarGroup } from '../../component/AvatarGroup'; | ||
|
||
describe('AvatarGroup Component', () => { | ||
it('should render correctly', () => { | ||
const props = { | ||
imgList: [ | ||
{ | ||
imgUrl: '//http:/img.jpg' | ||
}, | ||
] | ||
}; | ||
|
||
const wrapper = shallow(<AvatarGroup {...props} />); | ||
|
||
expect(wrapper).toMatchSnapshot(); | ||
}); | ||
}); |
75 changes: 75 additions & 0 deletions
75
clientV2/__tests__/component/__snapshots__/Avatar.test.js.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`Avatar Component should render correctly 1`] = ` | ||
ShallowWrapper { | ||
Symbol(enzyme.__root__): [Circular], | ||
Symbol(enzyme.__unrendered__): <Unknown | ||
altText="" | ||
classes="" | ||
imgUrl="//http:/img.jpg" | ||
/>, | ||
Symbol(enzyme.__renderer__): Object { | ||
"batchedUpdates": [Function], | ||
"checkPropTypes": [Function], | ||
"getNode": [Function], | ||
"render": [Function], | ||
"simulateError": [Function], | ||
"simulateEvent": [Function], | ||
"unmount": [Function], | ||
}, | ||
Symbol(enzyme.__node__): Object { | ||
"instance": null, | ||
"key": undefined, | ||
"nodeType": "host", | ||
"props": Object { | ||
"alt": "", | ||
"className": "avatar ", | ||
"src": "//http:/img.jpg", | ||
}, | ||
"ref": null, | ||
"rendered": null, | ||
"type": "img", | ||
}, | ||
Symbol(enzyme.__nodes__): Array [ | ||
Object { | ||
"instance": null, | ||
"key": undefined, | ||
"nodeType": "host", | ||
"props": Object { | ||
"alt": "", | ||
"className": "avatar ", | ||
"src": "//http:/img.jpg", | ||
}, | ||
"ref": null, | ||
"rendered": null, | ||
"type": "img", | ||
}, | ||
], | ||
Symbol(enzyme.__options__): Object { | ||
"adapter": ReactSixteenAdapter { | ||
"options": Object { | ||
"enableComponentDidUpdateOnSetState": true, | ||
"legacyContextMode": "parent", | ||
"lifecycles": Object { | ||
"componentDidUpdate": Object { | ||
"onSetState": true, | ||
}, | ||
"getChildContext": Object { | ||
"calledByRenderer": false, | ||
}, | ||
"getDerivedStateFromError": false, | ||
"getDerivedStateFromProps": Object { | ||
"hasShouldComponentUpdateBug": false, | ||
}, | ||
"getSnapshotBeforeUpdate": true, | ||
"setState": Object { | ||
"skipsComponentDidUpdateOnNullish": true, | ||
}, | ||
}, | ||
}, | ||
}, | ||
Symbol(enzyme.__providerValues__): undefined, | ||
}, | ||
Symbol(enzyme.__providerValues__): Map {}, | ||
} | ||
`; |
164 changes: 164 additions & 0 deletions
164
clientV2/__tests__/component/__snapshots__/AvatarGroup.test.js.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,164 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`AvatarGroup Component should render correctly 1`] = ` | ||
ShallowWrapper { | ||
Symbol(enzyme.__root__): [Circular], | ||
Symbol(enzyme.__unrendered__): <Unknown | ||
classes="" | ||
imgList={ | ||
Array [ | ||
Object { | ||
"imgUrl": "//http:/img.jpg", | ||
}, | ||
] | ||
} | ||
/>, | ||
Symbol(enzyme.__renderer__): Object { | ||
"batchedUpdates": [Function], | ||
"checkPropTypes": [Function], | ||
"getNode": [Function], | ||
"render": [Function], | ||
"simulateError": [Function], | ||
"simulateEvent": [Function], | ||
"unmount": [Function], | ||
}, | ||
Symbol(enzyme.__node__): Object { | ||
"instance": null, | ||
"key": undefined, | ||
"nodeType": "host", | ||
"props": Object { | ||
"children": Array [ | ||
Array [ | ||
<div | ||
className="avatar-item " | ||
> | ||
<Unknown | ||
altText="" | ||
classes="" | ||
imgUrl="//http:/img.jpg" | ||
/> | ||
</div>, | ||
], | ||
false, | ||
], | ||
"className": "avatar-group", | ||
}, | ||
"ref": null, | ||
"rendered": Array [ | ||
Object { | ||
"instance": null, | ||
"key": "img0", | ||
"nodeType": "host", | ||
"props": Object { | ||
"children": <Unknown | ||
altText="" | ||
classes="" | ||
imgUrl="//http:/img.jpg" | ||
/>, | ||
"className": "avatar-item ", | ||
}, | ||
"ref": null, | ||
"rendered": Object { | ||
"instance": null, | ||
"key": undefined, | ||
"nodeType": "function", | ||
"props": Object { | ||
"altText": "", | ||
"classes": "", | ||
"imgUrl": "//http:/img.jpg", | ||
}, | ||
"ref": null, | ||
"rendered": null, | ||
"type": [Function], | ||
}, | ||
"type": "div", | ||
}, | ||
false, | ||
], | ||
"type": "div", | ||
}, | ||
Symbol(enzyme.__nodes__): Array [ | ||
Object { | ||
"instance": null, | ||
"key": undefined, | ||
"nodeType": "host", | ||
"props": Object { | ||
"children": Array [ | ||
Array [ | ||
<div | ||
className="avatar-item " | ||
> | ||
<Unknown | ||
altText="" | ||
classes="" | ||
imgUrl="//http:/img.jpg" | ||
/> | ||
</div>, | ||
], | ||
false, | ||
], | ||
"className": "avatar-group", | ||
}, | ||
"ref": null, | ||
"rendered": Array [ | ||
Object { | ||
"instance": null, | ||
"key": "img0", | ||
"nodeType": "host", | ||
"props": Object { | ||
"children": <Unknown | ||
altText="" | ||
classes="" | ||
imgUrl="//http:/img.jpg" | ||
/>, | ||
"className": "avatar-item ", | ||
}, | ||
"ref": null, | ||
"rendered": Object { | ||
"instance": null, | ||
"key": undefined, | ||
"nodeType": "function", | ||
"props": Object { | ||
"altText": "", | ||
"classes": "", | ||
"imgUrl": "//http:/img.jpg", | ||
}, | ||
"ref": null, | ||
"rendered": null, | ||
"type": [Function], | ||
}, | ||
"type": "div", | ||
}, | ||
false, | ||
], | ||
"type": "div", | ||
}, | ||
], | ||
Symbol(enzyme.__options__): Object { | ||
"adapter": ReactSixteenAdapter { | ||
"options": Object { | ||
"enableComponentDidUpdateOnSetState": true, | ||
"legacyContextMode": "parent", | ||
"lifecycles": Object { | ||
"componentDidUpdate": Object { | ||
"onSetState": true, | ||
}, | ||
"getChildContext": Object { | ||
"calledByRenderer": false, | ||
}, | ||
"getDerivedStateFromError": false, | ||
"getDerivedStateFromProps": Object { | ||
"hasShouldComponentUpdateBug": false, | ||
}, | ||
"getSnapshotBeforeUpdate": true, | ||
"setState": Object { | ||
"skipsComponentDidUpdateOnNullish": true, | ||
}, | ||
}, | ||
}, | ||
}, | ||
Symbol(enzyme.__providerValues__): undefined, | ||
}, | ||
Symbol(enzyme.__providerValues__): Map {}, | ||
} | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import Enzyme from 'enzyme'; | ||
import Adapter from 'enzyme-adapter-react-16'; | ||
|
||
Enzyme.configure({ adapter: new Adapter() }); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
module.exports = { | ||
clearMocks: true, | ||
coverageDirectory: 'coverage', | ||
testRegex: '(roots/.*|(\\.|/)(test))\\.(js|jsx)?$', | ||
testEnvironment: 'node', | ||
testPathIgnorePatterns: [ | ||
'/node_modules/', | ||
'/cypress/', | ||
'/__tests__/setup/', | ||
], | ||
setupTestFrameworkScriptFile: '<rootDir>/__tests__/setup/setupEnzyme.js', | ||
moduleNameMapper: { | ||
'\\.(css|less|sass|scss)$': '<rootDir>/__mocks__/styleMock.js', | ||
'\\.(gif|ttf|eot|svg)$': '<rootDir>/__mocks__/fileMock.js', | ||
}, | ||
}; |