mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-07-28 18:24:38 -05:00
Improve 404 navigation and styling
This commit is contained in:
@@ -355,14 +355,14 @@ describe('DocumentDetailComponent', () => {
|
||||
.mockReturnValueOnce(throwError(() => new Error('unable to discard')))
|
||||
component.discard()
|
||||
fixture.detectChanges()
|
||||
expect(navigateSpy).toHaveBeenCalledWith(['404'])
|
||||
expect(navigateSpy).toHaveBeenCalledWith(['404'], { replaceUrl: true })
|
||||
})
|
||||
|
||||
it('should 404 on invalid id', () => {
|
||||
jest.spyOn(documentService, 'get').mockReturnValueOnce(of(null))
|
||||
const navigateSpy = jest.spyOn(router, 'navigate')
|
||||
fixture.detectChanges()
|
||||
expect(navigateSpy).toHaveBeenCalledWith(['404'])
|
||||
expect(navigateSpy).toHaveBeenCalledWith(['404'], { replaceUrl: true })
|
||||
})
|
||||
|
||||
it('should support save, close and show success toast', () => {
|
||||
|
@@ -341,7 +341,9 @@ export class DocumentDetailComponent
|
||||
this.openDocumentService.setDirty(doc, dirty)
|
||||
},
|
||||
error: (error) => {
|
||||
this.router.navigate(['404'])
|
||||
this.router.navigate(['404'], {
|
||||
replaceUrl: true,
|
||||
})
|
||||
},
|
||||
})
|
||||
|
||||
@@ -513,7 +515,9 @@ export class DocumentDetailComponent
|
||||
this.openDocumentService.setDirty(doc, false)
|
||||
},
|
||||
error: () => {
|
||||
this.router.navigate(['404'])
|
||||
this.router.navigate(['404'], {
|
||||
replaceUrl: true,
|
||||
})
|
||||
},
|
||||
})
|
||||
}
|
||||
|
Reference in New Issue
Block a user