Skip to content

Commit

Permalink
fix(vtmn/svelte): VtmnListItem tabindex can be false
Browse files Browse the repository at this point in the history
  • Loading branch information
Tlahey committed Mar 25, 2024
1 parent 9867a64 commit a435ddb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@
{#if href}
<a
class="vtmn-list__link"
tabindex={disabled && -1}
tabindex={disabled ? -1 : 0}
{href}
{target}
on:click|stopPropagation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ describe('VtmnListItem', () => {
});
expect(getByRole('link')).toHaveAttribute('href', 'https://decathlon.fr');
expect(getByRole('link')).toHaveAttribute('aria-disabled', 'true');
expect(getByRole('link')).toHaveAttribute('tabindex', '-1');
});
test('Should have a link _blank with noopener noreferrer', () => {
const { getByRole } = render(VtmnListItem, {
Expand All @@ -96,5 +97,6 @@ describe('VtmnListItem', () => {
expect(getByRole('link')).toHaveAttribute('href', 'https://decathlon.fr');
expect(getByRole('link')).toHaveAttribute('target', '_blank');
expect(getByRole('link')).toHaveAttribute('rel', 'noopener noreferrer');
expect(getByRole('link')).toHaveAttribute('tabindex', undefined);
});
});

0 comments on commit a435ddb

Please sign in to comment.