mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-07-24 17:31:52 +00:00
[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:
@@ -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', () => {
|
||||
|
Reference in New Issue
Block a user