Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions ui/src/app/collection/detail/manage-collection.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -483,6 +483,22 @@ describe("ManageCollectionComponent", () => {
expect(component.getApiSearch).not.toHaveBeenCalled()
})

it("remove skills should have api search with query", () => {
component.selectAllChecked = true
const searchQuery = "art"
component.searchForm?.get("search")?.patchValue(searchQuery)
component.removeFromCollection()
expect(component.apiSearch?.query).toEqual(searchQuery)
})

it("remove skills should have api search with query", () => {
component.selectAllChecked = true
component.removeFromCollection()
const date = new Date()
component.collection = createMockCollection(date, date, date, date, PublishStatus.Workspace)
expect(component.apiSearch?.uuids?.length).toBeGreaterThan(0)
})

it("submitSkillRemoval should be correct", () => {
// Arrange
const spyReloadCollection = spyOn(component, "reloadCollection").and.returnValue()
Expand Down
6 changes: 3 additions & 3 deletions ui/src/app/collection/detail/manage-collection.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -324,9 +324,9 @@ export class ManageCollectionComponent extends SkillsListComponent implements On

getApiSearch(skill?: ApiSkillSummary): ApiSearch | undefined {
if (this.selectAllChecked) {
return new ApiSearch({
query: this.searchQuery
})
return this.searchQuery
? new ApiSearch({query: this.searchQuery})
: new ApiSearch({uuids: this.collection?.skills.map((i: any) => i.uuid)})
} else {
return super.getApiSearch(skill)
}
Expand Down