Skip to content

Commit

Permalink
Clarify 'when href, target, rel and onClick' test
Browse files Browse the repository at this point in the history
  • Loading branch information
OleksandrNechai committed Sep 18, 2024
1 parent 85e4452 commit b32a83c
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions packages/base/Link/src/Link/test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -128,19 +128,17 @@ describe('calculateViewModel', () => {
})
})

describe('when href, target, rel and onClick are provided', () => {
it('applies correct href, target, rel, and onClick', () => {
describe('when href, target and onClick are provided', () => {
it('passes them through to view model', () => {
const props = {
href: 'https://example.com',
target: '_blank',
rel: 'nofollow',
onClick: jest.fn(),
}
const result = calculateViewModel(props)

expect(result.href).toBe('https://example.com')
expect(result.target).toBe('_blank')
expect(result.rel).toBe('nofollow noopener')
expect(result.onClick).toBe(props.onClick)
})
})
Expand Down

0 comments on commit b32a83c

Please sign in to comment.