mirror of
https://github.com/fergalmoran/turnstone.git
synced 2025-12-22 09:49:56 +00:00
Tweaks to item test
This commit is contained in:
@@ -21,25 +21,26 @@ const item = {
|
||||
}
|
||||
}
|
||||
|
||||
const index = 0
|
||||
|
||||
const component = renderer.create(
|
||||
<StateContextProvider styles={customStyles} text={'Chi'} items={[item]}>
|
||||
<Item
|
||||
index={0}
|
||||
key={'item0'}
|
||||
index={index}
|
||||
key={`item${index}`}
|
||||
item={item}
|
||||
/>
|
||||
</StateContextProvider>
|
||||
)
|
||||
let tree = component.toJSON()
|
||||
|
||||
|
||||
describe('Item', () => {
|
||||
test('Component renders correctly', () => {
|
||||
expect(tree).toMatchSnapshot()
|
||||
})
|
||||
|
||||
test('Link changes the class when hovered', () => {
|
||||
// Manually trigger onMouseEnter callback and rerender
|
||||
// Manually trigger onMouseEnter and rerender
|
||||
tree.props.onMouseEnter()
|
||||
tree = component.toJSON()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user