Clean up test.

This commit is contained in:
Michael Spalti
2021-12-06 12:56:13 -08:00
parent b4b17136a6
commit c112a036df

View File

@@ -42,7 +42,7 @@ let fixture: ComponentFixture<EditBitstreamPageComponent>;
describe('EditBitstreamPageComponent', () => {
beforeEach(waitForAsync(() => {
beforeEach(() => {
allFormats = [
Object.assign({
id: '1',
@@ -73,13 +73,7 @@ describe('EditBitstreamPageComponent', () => {
})
] as BitstreamFormat[];
selectedFormat = allFormats[1];
notificationsService = jasmine.createSpyObj('notificationsService',
{
info: infoNotification,
warning: warningNotification,
success: successNotification
}
);
formService = Object.assign({
createFormGroup: (fModel: DynamicFormControlModel[]) => {
const controls = {};
@@ -92,6 +86,24 @@ describe('EditBitstreamPageComponent', () => {
return undefined;
}
});
bitstreamFormatService = jasmine.createSpyObj('bitstreamFormatService', {
findAll: createSuccessfulRemoteDataObject$(createPaginatedList(allFormats))
});
notificationsService = jasmine.createSpyObj('notificationsService',
{
info: infoNotification,
warning: warningNotification,
success: successNotification
}
);
});
describe('EditBitstreamPageComponent no IIIF fields', () => {
beforeEach(waitForAsync(() => {
bitstream = Object.assign(new Bitstream(), {
metadata: {
'dc.description': [
@@ -252,18 +264,11 @@ describe('EditBitstreamPageComponent', () => {
expect(router.navigate).toHaveBeenCalledWith([getEntityEditRoute(null, 'some-uuid'), 'bitstreams']);
});
});
});
});
describe('EditBitstreamPageComponent with IIIF', () => {
describe('EditBitstreamPageComponent with IIIF fields', () => {
beforeEach(waitForAsync(() => {
bitstreamService = jasmine.createSpyObj('bitstreamService', {
findById: createSuccessfulRemoteDataObject$(bitstream),
update: createSuccessfulRemoteDataObject$(bitstream),
updateFormat: createSuccessfulRemoteDataObject$(bitstream),
commitUpdates: {},
patch: {}
});
bitstream = Object.assign(new Bitstream(), {
metadata: {
'dc.description': [
@@ -381,4 +386,5 @@ describe('EditBitstreamPageComponent with IIIF', () => {
expect(rawForm.iiifHeightContainer.iiifHeight).toEqual('2800');
});
});
});
});