Skip to content

Commit

Permalink
Fix unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
adomi committed Feb 22, 2021
1 parent 22641f8 commit b2dfb43
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,7 @@ describe('ContentNodeSelectorPanelComponent', () => {
});

it('should not show the breadcrumb if search was performed as last action', async () => {
component.searchTerm = 'mock-search-term';
triggerSearchResults(fakeResultSetPaging);

fixture.detectChanges();
Expand All @@ -263,6 +264,7 @@ describe('ContentNodeSelectorPanelComponent', () => {
});

it('should show the breadcrumb for the selected node when search results are displayed', async () => {
component.searchTerm = 'mock-search-term';
triggerSearchResults(fakeResultSetPaging);

const chosenNode = new Node({ path: { elements: ['one'] } });
Expand Down Expand Up @@ -642,6 +644,7 @@ describe('ContentNodeSelectorPanelComponent', () => {
}));

it('should emit showingSearch event with true while searching', async () => {
component.searchTerm = 'mock-search-term';
spyOn(customResourcesService, 'hasCorrespondingNodeIds').and.returnValue(true);
const showingSearchSpy = spyOn(component.showingSearch, 'emit');

Expand Down Expand Up @@ -685,6 +688,7 @@ describe('ContentNodeSelectorPanelComponent', () => {
});

it('should emit showingResults event with false if search api fails', async () => {
component.searchTerm = 'mock-search-term';
getCorrespondingNodeIdsSpy.and.throwError('Failed');
const showingSearchSpy = spyOn(component.showingSearch, 'emit');
component.queryBuilderService.execute({ query: { query: 'search' } });
Expand Down

0 comments on commit b2dfb43

Please sign in to comment.