Skip to content

Commit

Permalink
Add more tests to suggested post format.
Browse files Browse the repository at this point in the history
  • Loading branch information
mtias committed Oct 31, 2017
1 parent 3f75acf commit c13b6ba
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions editor/test/selectors.js
Original file line number Diff line number Diff line change
Expand Up @@ -2132,6 +2132,33 @@ describe( 'selectors', () => {

expect( getSuggestedPostFormat( state ) ).toBe( 'quote' );
} );

it( 'returns Video if the first block is of type `core-embed/youtube`', () => {
const state = {
editor: {
blockOrder: [ 567 ],
blocksByUid: {
567: { uid: 567, name: 'core-embed/youtube' },
},
},
};

expect( getSuggestedPostFormat( state ) ).toBe( 'video' );
} );

it( 'returns Quote if the first block is of type `core/quote` and second is of type `core/paragraph`', () => {
const state = {
editor: {
blockOrder: [ 456, 789 ],
blocksByUid: {
456: { uid: 456, name: 'core/quote' },
789: { uid: 789, name: 'core/paragraph' },
},
},
};

expect( getSuggestedPostFormat( state ) ).toBe( 'quote' );
} );
} );

describe( 'getNotices', () => {
Expand Down

0 comments on commit c13b6ba

Please sign in to comment.