Added tests for iiif form field content at startup

This commit is contained in:
Michael Spalti
2021-12-04 13:54:48 -08:00
parent 9ae38f4a6c
commit e521f2d579

View File

@@ -276,7 +276,27 @@ describe('EditBitstreamPageComponent', () => {
{ {
value: 'Bitstream title' value: 'Bitstream title'
} }
] ],
'iiif.label': [
{
value: 'chapter one'
}
],
'iiif.toc': [
{
value: 'chapter one'
}
],
'iiif.image.width': [
{
value: '2400'
}
],
'iiif.image.height': [
{
value: '2800'
}
],
}, },
format: createSuccessfulRemoteDataObject$(selectedFormat), format: createSuccessfulRemoteDataObject$(selectedFormat),
_links: { _links: {
@@ -334,6 +354,11 @@ describe('EditBitstreamPageComponent', () => {
}); });
describe('on startup', () => { describe('on startup', () => {
let rawForm;
beforeEach(() => {
rawForm = comp.formGroup.getRawValue();
});
it('should set isIIIF to true', () => { it('should set isIIIF to true', () => {
expect(comp.isIIIF).toBeTrue(); expect(comp.isIIIF).toBeTrue();
}); });
@@ -349,6 +374,18 @@ describe('EditBitstreamPageComponent', () => {
it('should put the \"IIIF Height\" input to be shown', () => { it('should put the \"IIIF Height\" input to be shown', () => {
expect(comp.formLayout.iiifHeight.grid.host).toContain('col'); expect(comp.formLayout.iiifHeight.grid.host).toContain('col');
}); });
it('should fill in the iiif label', () => {
expect(rawForm.fileNamePrimaryContainer.fileName).toEqual('chapter one');
});
it('should fill in the iiif toc', () => {
expect(rawForm.fileNamePrimaryContainer.fileName).toEqual('chapter one');
});
it('should fill in the iiif width', () => {
expect(rawForm.fileNamePrimaryContainer.fileName).toEqual('2400');
});
it('should fill in the iiif height', () => {
expect(rawForm.fileNamePrimaryContainer.fileName).toEqual('2800');
});
}); });
})); }));