diff --git a/src/components/EntryEditor/__tests__/EntryEditorToolbar.spec.js b/src/components/EntryEditor/__tests__/EntryEditorToolbar.spec.js index 5da4eb64..c8e28d65 100644 --- a/src/components/EntryEditor/__tests__/EntryEditorToolbar.spec.js +++ b/src/components/EntryEditor/__tests__/EntryEditorToolbar.spec.js @@ -3,7 +3,7 @@ import { shallow } from 'enzyme'; import EntryEditorToolbar from '../EntryEditorToolbar'; describe('EntryEditorToolbar', () => { - it('should have both buttons enabled initially', () => { + it('should have the Save button disabled initally, and the Cancel button enabled', () => { const component = shallow( {}} @@ -15,6 +15,19 @@ describe('EntryEditorToolbar', () => { expect(tree).toMatchSnapshot(); }); + it('should enable the Save button', () => { + const component = shallow( + {}} + onCancelEdit={() => {}} + onDelete={() => {}} + /> + ); + const tree = component.html(); + expect(tree).toMatchSnapshot(); + }); + it('should disable and update label of Save button when persisting', () => { const component = shallow( "`; -exports[`EntryEditorToolbar should have both buttons enabled initially 1`] = `"
"`; +exports[`EntryEditorToolbar should enable the Save button 1`] = `"
"`; + +exports[`EntryEditorToolbar should have the Save button disabled initally, and the Cancel button enabled 1`] = `"
"`;