mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2026-10-13 19:47:13 +00:00
Add hostname label
This commit is contained in:
3 files changed
+42
-3
No files matched your search
@@ -221,4 +221,19 @@ describe('ChatComponent', () => {
|
||||
expect(el.querySelector('.chat-markdown script')).toBeNull()
|
||||
expect(el.textContent).toContain('**user**')
|
||||
})
|
||||
|
||||
it('should keep the destination hostname visible after sanitizing chat links', () => {
|
||||
component.messages.set([
|
||||
{
|
||||
role: 'assistant',
|
||||
content:
|
||||
'[View original document](https://otherdomain.example/?data=secret)',
|
||||
},
|
||||
])
|
||||
fixture.detectChanges()
|
||||
const el: HTMLElement = fixture.nativeElement
|
||||
const link = el.querySelector('.chat-markdown a')
|
||||
expect(link?.textContent).toBe('View original document')
|
||||
expect(link?.nextElementSibling?.textContent).toBe('(otherdomain.example)')
|
||||
})
|
||||
})
|
||||
Reference in new issue
Block a user