Skip to content

Commit

Permalink
InserterMenu: Fix tests to detect #3737
Browse files Browse the repository at this point in the history
  • Loading branch information
mcsf committed Nov 30, 2017
1 parent 1c53b02 commit 8a6696b
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions editor/components/inserter/test/menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,14 +147,22 @@ describe( 'InserterMenu', () => {
position={ 'top center' }
instanceId={ 1 }
blocks={ [] }
recentlyUsedBlocks={ [ advancedTextBlock ] }
recentlyUsedBlocks={ [
// Actually recently used by user, thus present at the top.
advancedTextBlock,
// Blocks of category 'common' injected on SETUP_EDITOR.
// These have to be listed here in the order in which they
// are registered.
textBlock,
someOtherBlock,
] }
debouncedSpeak={ noop }
blockTypes
/>
);

const visibleBlocks = wrapper.find( '.editor-inserter__block' );
expect( visibleBlocks.length ).toBe( 1 );
expect( visibleBlocks.length ).toBe( 3 );
expect( visibleBlocks.at( 0 ).childAt( 0 ).name() ).toBe( 'BlockIcon' );
expect( visibleBlocks.at( 0 ).text() ).toBe( 'Advanced Text' );
} );
Expand Down

0 comments on commit 8a6696b

Please sign in to comment.