mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2026-01-12 21:44:21 -06:00
Fix test
This commit is contained in:
@@ -13,6 +13,7 @@ import {
|
|||||||
} from '@angular/core/testing'
|
} from '@angular/core/testing'
|
||||||
import { FormsModule, ReactiveFormsModule } from '@angular/forms'
|
import { FormsModule, ReactiveFormsModule } from '@angular/forms'
|
||||||
import { By } from '@angular/platform-browser'
|
import { By } from '@angular/platform-browser'
|
||||||
|
import { RouterLinkWithHref } from '@angular/router'
|
||||||
import { RouterTestingModule } from '@angular/router/testing'
|
import { RouterTestingModule } from '@angular/router/testing'
|
||||||
import {
|
import {
|
||||||
NgbModal,
|
NgbModal,
|
||||||
@@ -230,12 +231,15 @@ describe('ManagementListComponent', () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
it('should support quick filter for objects', () => {
|
it('should support quick filter for objects', () => {
|
||||||
const qfSpy = jest.spyOn(documentListViewService, 'quickFilter')
|
const expectedUrl = documentListViewService.getQuickFilterUrl([
|
||||||
const filterButton = fixture.debugElement.queryAll(By.css('button'))[9]
|
|
||||||
filterButton.triggerEventHandler('click')
|
|
||||||
expect(qfSpy).toHaveBeenCalledWith([
|
|
||||||
{ rule_type: FILTER_HAS_TAGS_ALL, value: tags[0].id.toString() },
|
{ rule_type: FILTER_HAS_TAGS_ALL, value: tags[0].id.toString() },
|
||||||
]) // subclasses set the filter rule type
|
])
|
||||||
|
const filterLink = fixture.debugElement.query(
|
||||||
|
By.css('a.btn-outline-secondary')
|
||||||
|
)
|
||||||
|
expect(filterLink).toBeTruthy()
|
||||||
|
const routerLink = filterLink.injector.get(RouterLinkWithHref)
|
||||||
|
expect(routerLink.urlTree).toEqual(expectedUrl)
|
||||||
})
|
})
|
||||||
|
|
||||||
it('should reload on sort', () => {
|
it('should reload on sort', () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user