From e521f2d579797a2f8ea8f1e27abe0c1a4d649b68 Mon Sep 17 00:00:00 2001 From: Michael Spalti Date: Sat, 4 Dec 2021 13:54:48 -0800 Subject: [PATCH] Added tests for iiif form field content at startup --- .../edit-bitstream-page.component.spec.ts | 39 ++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) diff --git a/src/app/bitstream-page/edit-bitstream-page/edit-bitstream-page.component.spec.ts b/src/app/bitstream-page/edit-bitstream-page/edit-bitstream-page.component.spec.ts index 1425372e59..1283ea956c 100644 --- a/src/app/bitstream-page/edit-bitstream-page/edit-bitstream-page.component.spec.ts +++ b/src/app/bitstream-page/edit-bitstream-page/edit-bitstream-page.component.spec.ts @@ -276,7 +276,27 @@ describe('EditBitstreamPageComponent', () => { { 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), _links: { @@ -334,6 +354,11 @@ describe('EditBitstreamPageComponent', () => { }); describe('on startup', () => { + let rawForm; + + beforeEach(() => { + rawForm = comp.formGroup.getRawValue(); + }); it('should set isIIIF to true', () => { expect(comp.isIIIF).toBeTrue(); }); @@ -349,6 +374,18 @@ describe('EditBitstreamPageComponent', () => { it('should put the \"IIIF Height\" input to be shown', () => { 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'); + }); }); }));