Create paperlesstasks for sanity, classifier

[ci skip]
This commit is contained in:
shamoon
2025-02-13 17:46:05 -08:00
parent de5f66b3a0
commit f897447a65
12 changed files with 120 additions and 17 deletions

View File

@@ -33,7 +33,7 @@ describe('TasksService', () => {
it('calls tasks api endpoint on reload', () => {
tasksService.reload()
const req = httpTestingController.expectOne(
`${environment.apiBaseUrl}tasks/`
`${environment.apiBaseUrl}tasks/?type=file`
)
expect(req.request.method).toEqual('GET')
})
@@ -41,7 +41,9 @@ describe('TasksService', () => {
it('does not call tasks api endpoint on reload if already loading', () => {
tasksService.loading = true
tasksService.reload()
httpTestingController.expectNone(`${environment.apiBaseUrl}tasks/`)
httpTestingController.expectNone(
`${environment.apiBaseUrl}tasks/?type=file`
)
})
it('calls acknowledge_tasks api endpoint on dismiss and reloads', () => {
@@ -55,7 +57,9 @@ describe('TasksService', () => {
})
req.flush([])
// reload is then called
httpTestingController.expectOne(`${environment.apiBaseUrl}tasks/`).flush([])
httpTestingController
.expectOne(`${environment.apiBaseUrl}tasks/?type=file`)
.flush([])
})
it('sorts tasks returned from api', () => {
@@ -106,7 +110,7 @@ describe('TasksService', () => {
tasksService.reload()
const req = httpTestingController.expectOne(
`${environment.apiBaseUrl}tasks/`
`${environment.apiBaseUrl}tasks/?type=file`
)
req.flush(mockTasks)

View File

@@ -54,7 +54,7 @@ export class TasksService {
this.loading = true
this.http
.get<PaperlessTask[]>(`${this.baseUrl}tasks/`)
.get<PaperlessTask[]>(`${this.baseUrl}tasks/?type=file`)
.pipe(takeUntil(this.unsubscribeNotifer), first())
.subscribe((r) => {
this.fileTasks = r.filter((t) => t.type == PaperlessTaskType.File) // they're all File tasks, for now