mirror of
https://github.com/zhigang1992/react.git
synced 2026-04-24 20:35:38 +08:00
test(user): add a new test to check altText
This commit is contained in:
@@ -32,4 +32,11 @@ describe(' User', () => {
|
||||
const link = wrapper.find('a')
|
||||
expect(link.length).not.toBe(0)
|
||||
})
|
||||
|
||||
it('should pass alt attribute', () => {
|
||||
const wrapper = mount(
|
||||
<User name="witt" src="https://unix.bio/assets/avatar.png" altText="witt"/>
|
||||
)
|
||||
expect(wrapper.find('img').prop('alt')).toEqual('witt')
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user