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(
|
const component = renderer.create(
|
||||||
<StateContextProvider styles={customStyles} text={'Chi'} items={[item]}>
|
<StateContextProvider styles={customStyles} text={'Chi'} items={[item]}>
|
||||||
<Item
|
<Item
|
||||||
index={0}
|
index={index}
|
||||||
key={'item0'}
|
key={`item${index}`}
|
||||||
item={item}
|
item={item}
|
||||||
/>
|
/>
|
||||||
</StateContextProvider>
|
</StateContextProvider>
|
||||||
)
|
)
|
||||||
let tree = component.toJSON()
|
let tree = component.toJSON()
|
||||||
|
|
||||||
|
|
||||||
describe('Item', () => {
|
describe('Item', () => {
|
||||||
test('Component renders correctly', () => {
|
test('Component renders correctly', () => {
|
||||||
expect(tree).toMatchSnapshot()
|
expect(tree).toMatchSnapshot()
|
||||||
})
|
})
|
||||||
|
|
||||||
test('Link changes the class when hovered', () => {
|
test('Link changes the class when hovered', () => {
|
||||||
// Manually trigger onMouseEnter callback and rerender
|
// Manually trigger onMouseEnter and rerender
|
||||||
tree.props.onMouseEnter()
|
tree.props.onMouseEnter()
|
||||||
tree = component.toJSON()
|
tree = component.toJSON()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user