Skip to content

Commit

Permalink
fix(Anchor): allow rel property in TS
Browse files Browse the repository at this point in the history
  • Loading branch information
langz committed Jan 4, 2023
1 parent 98d5c4b commit dc06c80
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/dnb-eufemia/src/elements/Anchor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export type AnchorProps = {
}

export type AnchorAllProps = AnchorProps &
React.HTMLAttributes<HTMLAnchorElement> &
React.HTMLProps<HTMLAnchorElement> &
SpacingProps

const defaultProps = {}
Expand Down
9 changes: 9 additions & 0 deletions packages/dnb-eufemia/src/elements/__tests__/Anchor.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,15 @@ describe('Anchor element', () => {
expect(document.body.querySelector('#' + id)).toBe(null)
})

it('supports rel', () => {
render(
<Anchor rel="external" href="http://www.externallink.com/">
text
</Anchor>
)
expect(document.querySelector('[rel="external"]')).toBeTruthy()
})

it('should validate with ARIA rules as a Anchor element', async () => {
const Component = render(<Anchor {...props} />)
expect(await axeComponent(Component)).toHaveNoViolations()
Expand Down

0 comments on commit dc06c80

Please sign in to comment.