mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2026-10-19 14:28:14 +00:00
Fix undefined title thjing
This commit is contained in:
2 files changed
+11
-1
No files matched your search
@@ -43,6 +43,13 @@ describe('PageHeaderComponent', () => {
|
||||
expect(titleSpy).toHaveBeenCalledWith(`Foo Bar - ${environment.appTitle}`)
|
||||
})
|
||||
|
||||
it('should set html title to just the app title until a title is available', () => {
|
||||
const titleSpy = jest.spyOn(titleService, 'setTitle')
|
||||
fixture.componentRef.setInput('title', undefined)
|
||||
fixture.detectChanges()
|
||||
expect(titleSpy).toHaveBeenCalledWith(environment.appTitle)
|
||||
})
|
||||
|
||||
it('should copy id to clipboard, reset after 3 seconds', () => {
|
||||
jest.useFakeTimers()
|
||||
fixture.componentRef.setInput('id', 42)
|
||||
|
||||
@@ -27,7 +27,10 @@ export class PageHeaderComponent {
|
||||
|
||||
constructor() {
|
||||
effect(() => {
|
||||
this.titleService.setTitle(`${this.title()} - ${environment.appTitle}`)
|
||||
const title = this.title()
|
||||
this.titleService.setTitle(
|
||||
title ? `${title} - ${environment.appTitle}` : environment.appTitle
|
||||
)
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user