Add coverage for refresh fields on create
This commit is contained in:
parent
eec57b4dfd
commit
46faa2996d
@ -896,6 +896,15 @@ describe('DocumentDetailComponent', () => {
|
|||||||
expect(component.getCustomFieldError(4)).toEqual(['Enter a valid URL.'])
|
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() {
|
function initNormally() {
|
||||||
jest
|
jest
|
||||||
.spyOn(documentService, 'get')
|
.spyOn(documentService, 'get')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user