From c13b6ba83e566d759547327b4d04251058e0bdf8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mat=C3=ADas=20Ventura?= Date: Tue, 31 Oct 2017 12:05:52 +0100 Subject: [PATCH] Add more tests to suggested post format. --- editor/test/selectors.js | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/editor/test/selectors.js b/editor/test/selectors.js index 26c7e77bf836e6..a1252667f4ee15 100644 --- a/editor/test/selectors.js +++ b/editor/test/selectors.js @@ -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', () => {