diff --git a/src-ui/src/app/components/document-detail/document-detail.component.spec.ts b/src-ui/src/app/components/document-detail/document-detail.component.spec.ts index c0f1e44b7..9f49e737b 100644 --- a/src-ui/src/app/components/document-detail/document-detail.component.spec.ts +++ b/src-ui/src/app/components/document-detail/document-detail.component.spec.ts @@ -896,6 +896,15 @@ describe('DocumentDetailComponent', () => { expect(component.getCustomFieldError(4)).toEqual(['Enter a valid URL.']) }) + it('should refresh custom fields when created', () => { + initNormally() + const refreshSpy = jest.spyOn(component, 'refreshCustomFields') + fixture.debugElement + .query(By.directive(CustomFieldsDropdownComponent)) + .triggerEventHandler('created') + expect(refreshSpy).toHaveBeenCalled() + }) + function initNormally() { jest .spyOn(documentService, 'get')