test(user): add a new test to check altText

This commit is contained in:
kentac55
2020-05-22 17:49:34 +09:00
committed by unix
parent cde23dd101
commit 9e6888bf00

View File

@@ -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')
})
})