Skip to content
This repository was archived by the owner on Sep 20, 2024. It is now read-only.

Commit c56d785

Browse files
authored
chore(tests): Added test for srcset in CImage
1 parent 8dc4127 commit c56d785

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

packages/chakra-ui-core/src/CImage/tests/CImage.test.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,10 @@ it('fallback src works', async () => {
4545
expect(screen.getByAltText(/Mesut Koca/i)).toHaveAttribute('src', 'LOAD_FALLBACK_SRC')
4646
})
4747
})
48+
49+
it('srcset works', async () => {
50+
renderComponent({ template: '<CImage alt="My Image Description" src="LOAD_SUCCESS_SRC" srcset="LOAD_SUCCESS_SRC 400w" />' })
51+
await wait(() => {
52+
expect(screen.getByAltText(/My Image Description/i)).toHaveAttribute('srcset', 'LOAD_SUCCESS_SRC 400w')
53+
})
54+
})

0 commit comments

Comments
 (0)