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

Commit 8ac592e

Browse files
committed
test(avatar): add tests for defaultavatar aria-label
1 parent ada159c commit 8ac592e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,12 @@ it('renders a name avatar if no src', async () => {
7272
})
7373
})
7474

75-
it('renders a name avatar if src fails', async () => {
75+
it('renders Default Avatar if src fails', async () => {
7676
renderComponent({ template: '<CAvatar name="Mesut Koca" src="LOAD_FAILURE_SRC" />' })
7777

7878
await wait(() => {
79-
expect(screen.queryByAltText(/Mesut Koca/i)).not.toBeInTheDocument()
79+
expect(screen.queryByAltText(/Mesut Koca/i)).not.toBeInTheDocument() // img
80+
expect(screen.getByLabelText(/Mesut Koca/i)).toBeInTheDocument() // DefaultAvatar
8081
expect(screen.getByText('MK')).toBeInTheDocument()
8182
})
8283
})

0 commit comments

Comments
 (0)