[ACA-1328] Use ADF Pagination in Personal Files and Libraries (#340)

This commit is contained in:
Cilibiu Bogdan
2018-04-30 17:14:52 +03:00
committed by Denys Vuika
parent e40b7f7489
commit 549abeb557
11 changed files with 114 additions and 297 deletions

View File

@@ -58,60 +58,6 @@ describe('PageComponent', () => {
});
});
describe('onFetchError()', () => {
it('sets isLoading state to false', () => {
component.isLoading = true;
component.onFetchError();
expect(component.isLoading).toBe(false);
});
});
describe('onPaginationChange()', () => {
it('fetch children nodes for current node id', () => {
component.node = { id: 'node-id' };
spyOn(component, 'fetchNodes').and.stub();
component.onPaginationChange({pagination: 'pagination-data'});
expect(component.fetchNodes).toHaveBeenCalledWith('node-id', { pagination: 'pagination-data' });
});
});
describe('onPageLoaded()', () => {
let page;
beforeEach(() => {
page = {
list: {
entries: ['a', 'b', 'c'],
pagination: {}
}
};
component.isLoading = true;
component.isEmpty = true;
component.onPageLoaded(page);
});
it('sets isLoading state to false', () => {
expect(component.isLoading).toBe(false);
});
it('sets component paging data', () => {
expect(component.paging).toBe(page);
});
it('sets component pagination data', () => {
expect(component.pagination).toEqual(page.list.pagination);
});
it('sets component isEmpty state', () => {
expect(component.isEmpty).toBe(false);
});
});
describe('hasSelection()', () => {
it('returns true when it has nodes selected', () => {
const hasSelection = component.hasSelection([ {}, {} ]);