Skip to content

Commit

Permalink
Add explicit tests for button text
Browse files Browse the repository at this point in the history
  • Loading branch information
danielbachhuber committed May 18, 2018
1 parent 414897c commit 625fcd9
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions editor/components/post-publish-panel/test/toggle.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,5 +57,26 @@ describe( 'PostPublishPanelToggle', () => {

expect( wrapper.prop( 'disabled' ) ).toBe( false );
} );

it( 'should display Schedule… if able to be scheduled', () => {
const wrapper = shallow(
<PostPublishPanelToggle isPublishable isSaveable isBeingScheduled />
);
expect( wrapper.childAt( 0 ).text() ).toBe( 'Schedule…' );
} );

it( 'should display Schedule… if able to be published', () => {
const wrapper = shallow(
<PostPublishPanelToggle isPublishable isSaveable hasPublishAction />
);
expect( wrapper.childAt( 0 ).text() ).toBe( 'Publish…' );
} );

it( 'should display Submit for Review… if not scheduled or publishable', () => {
const wrapper = shallow(
<PostPublishPanelToggle isPublishable isSaveable />
);
expect( wrapper.childAt( 0 ).text() ).toBe( 'Submit for Review…' );
} );
} );
} );

0 comments on commit 625fcd9

Please sign in to comment.