mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ADF-4056][ADF-4060][ADF-3930] Content Node Selector fix (#4293)
* remove target when search * content panel component infinite pagiantion and dropdown integration * fix insight karma
This commit is contained in:
@@ -116,6 +116,10 @@ describe('ContentNodeSelectorComponent', () => {
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should the document list use the server ordering', () => {
|
||||
expect(component.documentList.sorting).toBe('server');
|
||||
});
|
||||
|
||||
it('should trigger the select event when selection has been made', (done) => {
|
||||
const expectedNode = <Node> {};
|
||||
component.select.subscribe((nodes) => {
|
||||
@@ -350,6 +354,13 @@ describe('ContentNodeSelectorComponent', () => {
|
||||
const expectedDefaultFolderNode = <NodeEntry> { entry: { path: { elements: [] } } };
|
||||
|
||||
spyOn(documentListService, 'getFolderNode').and.returnValue(of(expectedDefaultFolderNode));
|
||||
spyOn(documentListService, 'getFolder').and.returnValue(of({
|
||||
list: {
|
||||
pagination: {},
|
||||
entries: [],
|
||||
source: {}
|
||||
}
|
||||
}));
|
||||
|
||||
const sitesService = TestBed.get(SitesService);
|
||||
spyOn(sitesService, 'getSites').and.returnValue(of({ list: { entries: [] } }));
|
||||
@@ -364,6 +375,8 @@ describe('ContentNodeSelectorComponent', () => {
|
||||
});
|
||||
|
||||
component.currentFolderId = 'cat-girl-nuku-nuku';
|
||||
component.documentList.ngOnInit();
|
||||
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
@@ -775,6 +788,44 @@ describe('ContentNodeSelectorComponent', () => {
|
||||
const paginationLoading = fixture.debugElement.query(spinnerSelector);
|
||||
expect(paginationLoading).not.toBeNull();
|
||||
}));
|
||||
|
||||
it('Should infinite pagination target be null when we use it for search ', fakeAsync(() => {
|
||||
component.showingSearchResults = true;
|
||||
|
||||
typeToSearchBox('shenron');
|
||||
|
||||
tick(debounceSearch);
|
||||
|
||||
fixture.detectChanges();
|
||||
|
||||
tick(debounceSearch);
|
||||
|
||||
expect(component.target).toBeNull();
|
||||
}));
|
||||
|
||||
it('Should infinite pagination target be present when search finish', fakeAsync(() => {
|
||||
component.showingSearchResults = true;
|
||||
|
||||
typeToSearchBox('shenron');
|
||||
|
||||
tick(debounceSearch);
|
||||
|
||||
fixture.detectChanges();
|
||||
|
||||
typeToSearchBox('');
|
||||
|
||||
tick(debounceSearch);
|
||||
|
||||
fixture.detectChanges();
|
||||
|
||||
expect(component.target).not.toBeNull();
|
||||
}));
|
||||
|
||||
it('Should infinite pagination target on init be the document list', fakeAsync(() => {
|
||||
component.showingSearchResults = true;
|
||||
|
||||
expect(component.target).toEqual(component.documentList);
|
||||
}));
|
||||
});
|
||||
});
|
||||
|
||||
|
Reference in New Issue
Block a user