mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-08-20 00:56:26 +00:00
Fix: including ordering param for id__in retrievals from frontend (#6875)
This commit is contained in:
@@ -66,6 +66,20 @@ describe('DocumentLinkComponent', () => {
|
||||
expect(getSpy).toHaveBeenCalled()
|
||||
})
|
||||
|
||||
it('shoud maintain ordering of selected documents', () => {
|
||||
const getSpy = jest.spyOn(documentService, 'getFew')
|
||||
getSpy.mockImplementation((ids) => {
|
||||
const docs = documents.filter((d) => ids.includes(d.id))
|
||||
return of({
|
||||
count: docs.length,
|
||||
all: docs.map((d) => d.id),
|
||||
results: docs,
|
||||
})
|
||||
})
|
||||
component.writeValue([12, 1])
|
||||
expect(component.selectedDocuments).toEqual([documents[1], documents[0]])
|
||||
})
|
||||
|
||||
it('should search API on select text input', () => {
|
||||
const listSpy = jest.spyOn(documentService, 'listFiltered')
|
||||
listSpy.mockImplementation(
|
||||
|
Reference in New Issue
Block a user