[CST-4499] Version history - Test

This commit is contained in:
Davide Negretti
2021-10-18 17:37:02 +02:00
parent 7c40c3ba68
commit bee628921a

View File

@@ -36,7 +36,7 @@ describe('ItemVersionsComponent', () => {
const versionHistory = Object.assign(new VersionHistory(), {
id: '1',
draftVersion: false,
draftVersion: true,
});
const version1 = Object.assign(new Version(), {
@@ -66,7 +66,7 @@ describe('ItemVersionsComponent', () => {
const versions = [version1, version2];
versionHistory.versions = createSuccessfulRemoteDataObject$(createPaginatedList(versions));
const item1 = Object.assign(new Item(), {
const item1 = Object.assign(new Item(), { // is a workspace item
uuid: 'item-identifier-1',
handle: '123456789/1',
version: createSuccessfulRemoteDataObject$(version1),
@@ -106,7 +106,6 @@ describe('ItemVersionsComponent', () => {
findByItem: of(undefined),
});
beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({
@@ -207,4 +206,12 @@ describe('ItemVersionsComponent', () => {
});
});
describe('when page is changed', () => {
it('should call getAllVersions', () => {
spyOn(component, 'getAllVersions');
component.onPageChange();
expect(component.getAllVersions).toHaveBeenCalled();
});
});
});