Skip to content

Commit

Permalink
test(NcAvatar): Test aria-label on menu toggle
Browse files Browse the repository at this point in the history
Signed-off-by: Christopher Ng <chrng8@gmail.com>
  • Loading branch information
Pytal committed Jan 26, 2024
1 parent 75ccec9 commit 16bff11
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/unit/components/NcAvatar/NcAvatar.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ describe('NcAvatar.vue', () => {
await nextTick()

expect(wrapper.find('.avatardiv__user-status').exists()).toBe(true)
expect(wrapper.attributes('aria-label')).toBe('Avatar of J. Doe, online')
expect(wrapper.find('.action-item__menutoggle').attributes('aria-label')).toBe('Avatar of J. Doe, online')
})

it('aria label is set to include status even if status is do-not-disturb', async () => {
Expand All @@ -63,7 +63,7 @@ describe('NcAvatar.vue', () => {
await nextTick()

expect(wrapper.find('.avatardiv__user-status').exists()).toBe(true)
expect(wrapper.attributes('aria-label')).toBe('Avatar of J. Doe, do not disturb')
expect(wrapper.find('.action-item__menutoggle').attributes('aria-label')).toBe('Avatar of J. Doe, do not disturb')
})

it('aria label is does not include status if status not shown', async () => {
Expand All @@ -85,7 +85,7 @@ describe('NcAvatar.vue', () => {
await nextTick()

expect(wrapper.find('.avatardiv__user-status').exists()).toBe(false)
expect(wrapper.attributes('aria-label')).toBe('Avatar of J. Doe')
expect(wrapper.find('.action-item__menutoggle').attributes('aria-label')).toBe('Avatar of J. Doe')
})

it('should display initials for user id', async () => {
Expand Down

0 comments on commit 16bff11

Please sign in to comment.