Skip to content

Commit

Permalink
fix foundDocument spec
Browse files Browse the repository at this point in the history
  • Loading branch information
lukavdplas committed Nov 8, 2023
1 parent 9f23a3b commit 91bd385
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions frontend/src/app/models/found-document.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,9 @@ describe('FoundDocument', () => {
const doc = makeDocument({ great_field: 'test' });
expect(doc.tags$.value).toEqual(mockTags);
const tag = _.first(mockTags);
doc.removeTag(tag.id);
doc.removeTag(tag);
expect(doc.tags$.value.length).toBe(1);
doc.addTag(tag.id);
doc.addTag(tag);
expect(doc.tags$.value.length).toBe(2);
});
});
4 changes: 2 additions & 2 deletions frontend/src/mock-data/tag.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ export class TagServiceMock {
}).pipe(tap(this.fetch.bind(this)));
}

setDocumentTags(document: FoundDocument, tagIds: number[]): Observable<Tag[]> {
const tags = mockTags.filter(tag => tagIds.includes(tag.id));
setDocumentTags(document: FoundDocument, tagIds: Tag[]): Observable<Tag[]> {
const tags = mockTags.filter(tag => tagIds.includes(tag));
return of(tags);
};

Expand Down

0 comments on commit 91bd385

Please sign in to comment.