mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-12-15 02:57:09 +01:00
Fix: some random frontend fixes and coverage
This commit is contained in:
parent
df2c139721
commit
0c883d064e
7 changed files with 49 additions and 18 deletions
|
|
@ -38,8 +38,10 @@ describe('SwitchComponent', () => {
|
|||
expect(component.value).toBeFalsy()
|
||||
})
|
||||
|
||||
it('should show note if unset', () => {
|
||||
it('should correctly report unset', () => {
|
||||
component.value = null
|
||||
expect(component.isUnset).toBeTruthy()
|
||||
component.value = undefined
|
||||
expect(component.isUnset).toBeTruthy()
|
||||
})
|
||||
})
|
||||
|
|
|
|||
|
|
@ -120,4 +120,12 @@ describe('DocumentCardLargeComponent', () => {
|
|||
expect(fixture.nativeElement.textContent).toContain('bananas')
|
||||
expect(component.searchNoteHighlights).toContain('<span>bananas</span>')
|
||||
})
|
||||
|
||||
it('should try to close the preview on mouse leave', () => {
|
||||
component.popupPreview = {
|
||||
close: jest.fn(),
|
||||
} as any
|
||||
component.mouseLeaveCard()
|
||||
expect(component.popupPreview.close).toHaveBeenCalled()
|
||||
})
|
||||
})
|
||||
|
|
|
|||
|
|
@ -108,12 +108,8 @@ export class DocumentCardLargeComponent extends ComponentWithPermissions {
|
|||
return this.documentService.getDownloadUrl(this.document.id)
|
||||
}
|
||||
|
||||
get previewUrl() {
|
||||
return this.documentService.getPreviewUrl(this.document.id)
|
||||
}
|
||||
|
||||
mouseLeaveCard() {
|
||||
this.popupPreview.close()
|
||||
this.popupPreview?.close()
|
||||
}
|
||||
|
||||
get contentTrimmed() {
|
||||
|
|
|
|||
|
|
@ -111,4 +111,12 @@ describe('DocumentCardSmallComponent', () => {
|
|||
fixture.debugElement.queryAll(By.directive(TagComponent))
|
||||
).toHaveLength(6)
|
||||
})
|
||||
|
||||
it('should try to close the preview on mouse leave', () => {
|
||||
component.popupPreview = {
|
||||
close: jest.fn(),
|
||||
} as any
|
||||
component.mouseLeaveCard()
|
||||
expect(component.popupPreview.close).toHaveBeenCalled()
|
||||
})
|
||||
})
|
||||
|
|
|
|||
|
|
@ -94,7 +94,7 @@ export class DocumentCardSmallComponent extends ComponentWithPermissions {
|
|||
}
|
||||
|
||||
mouseLeaveCard() {
|
||||
this.popupPreview.close()
|
||||
this.popupPreview?.close()
|
||||
}
|
||||
|
||||
get notesEnabled(): boolean {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue