Open updater toast changelog links externally (#4970)
* fix: Hook into markdown-generated anchors to avoid e.g breaking the desktop app * add comment * Disable eslint on copied line from ts-stack --------- Co-authored-by: marc2332 <mespinsanz@gmail.com>
This commit is contained in:
@ -150,4 +150,31 @@ describe('ToastUpdate tests', () => {
|
||||
expect(restartButton).toBeEnabled()
|
||||
expect(dismissButton).toBeEnabled()
|
||||
})
|
||||
|
||||
test('Happy path: external links render correctly', () => {
|
||||
const releaseNotesWithBreakingChanges = `
|
||||
## Some markdown release notes
|
||||
- [Zoo](https://zoo.dev/)
|
||||
`
|
||||
const onRestart = vi.fn()
|
||||
const onDismiss = vi.fn()
|
||||
|
||||
render(
|
||||
<ToastUpdate
|
||||
onRestart={onRestart}
|
||||
onDismiss={onDismiss}
|
||||
version={testData.version}
|
||||
releaseNotes={releaseNotesWithBreakingChanges}
|
||||
/>
|
||||
)
|
||||
|
||||
// Locators and other constants
|
||||
const zooDev = screen.getByText('Zoo', {
|
||||
selector: 'a',
|
||||
})
|
||||
|
||||
expect(zooDev).toHaveAttribute('href', 'https://zoo.dev/')
|
||||
expect(zooDev).toHaveAttribute('target', '_blank')
|
||||
expect(zooDev).toHaveAttribute('onClick')
|
||||
})
|
||||
})
|
||||
|
Reference in New Issue
Block a user