[ACS-8398] unit tests part 3 (#4163)

* ACS-8398 Unit tests for search ai effects

* ACS-8398 Unit tests for canDisplayKnowledgeRetrievalButton rule

* ACS-8398 Unit tests for changes in document base page

* ACS-8398 Added unit tests for changes in recent files component

* ACS-8398 Unit tests for changes in lists pages

* ACS-8398 Moved variable to inside of describe

* ACS-8398 Moved repeated code to function

* ACS-8398 Reverted one change

* ACS-8398 Fix after rebase

* ACS-8398 Fix issue with repeated code

* ACS-8398 Fix issue with repeated code

* ACS-8398 Fixed unit tests

* ACS-8398 Fixed unit tests

* ACS-8398 Trigger job
This commit is contained in:
AleksanderSklorz
2024-10-07 13:50:01 +02:00
committed by GitHub
parent 3ec6d0be32
commit 0fb9f9ebe3
9 changed files with 325 additions and 39 deletions

View File

@@ -30,7 +30,7 @@ import { NodeEntry, NodePaging } from '@alfresco/js-api';
import { DocumentBasePageService } from './document-base-page.service';
import { Store } from '@ngrx/store';
import { Component } from '@angular/core';
import { DiscoveryApiService, DocumentListComponent, DocumentListService, SearchAiService } from '@alfresco/adf-content-services';
import { DiscoveryApiService, DocumentListComponent, DocumentListService, SearchAiInputState, SearchAiService } from '@alfresco/adf-content-services';
import { MockStore, provideMockStore } from '@ngrx/store/testing';
import { AuthModule, UserPreferencesService } from '@alfresco/adf-core';
import { of, Subscription } from 'rxjs';
@@ -278,6 +278,22 @@ describe('PageComponent', () => {
expect(searchAiService.updateSearchAiInputState).not.toHaveBeenCalled();
});
});
describe('SearchAiService toggleSearchAiInput$ event handler', () => {
it('should set searchAiInputState', () => {
const initialSearchAiInputState = component.searchAiInputState;
const searchAiInputState: SearchAiInputState = {
active: true
};
searchAiService.toggleSearchAiInput$ = of(searchAiInputState);
component.ngOnInit();
expect(component.searchAiInputState).toBe(searchAiInputState);
expect(initialSearchAiInputState).toEqual({
active: false
});
});
});
});
describe('Info Drawer state', () => {