Add coverage for refresh fields on create

This commit is contained in:
shamoon 2023-11-04 21:40:17 -07:00
parent eec57b4dfd
commit 46faa2996d

View File

@ -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')