Show edited officer form on error

This commit is contained in:
Patrick Smith
2019-01-31 14:03:15 -05:00
parent 6fe9229f89
commit 41feb9e74f
4 changed files with 18 additions and 6 deletions

View File

@@ -22,6 +22,13 @@ describe('EditOfficerForm', () => {
expect(wrapper.vm.$data.editing).toEqual(true)
})
it('does start in editing mode when the form has changes', () => {
const wrapper = shallowMount(EditOfficerForm, {
propsData: { hasChanges: true },
})
expect(wrapper.vm.$data.editing).toEqual(true)
})
it('starts editing when edit method called', () => {
const wrapper = shallowMount(EditOfficerForm)
wrapper.vm.edit({ preventDefault: () => null })