Skip to content

Commit

Permalink
fix BlockSwitcher tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ntsekouras committed Dec 12, 2020
1 parent 499b55e commit a8e1818
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions packages/block-editor/src/components/block-switcher/test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ describe( 'BlockSwitcher', () => {
test( 'should render switcher with blocks', () => {
useSelect.mockImplementation( () => ( {
blocks: [ headingBlock1 ],
inserterItems: [
possibleBlockTransformations: [
{ name: 'core/heading', frecency: 1 },
{ name: 'core/paragraph', frecency: 1 },
],
Expand All @@ -117,10 +117,7 @@ describe( 'BlockSwitcher', () => {
test( 'should render disabled block switcher with multi block of different types when no transforms', () => {
useSelect.mockImplementation( () => ( {
blocks: [ headingBlock1, textBlock ],
inserterItems: [
{ name: 'core/heading', frecency: 1 },
{ name: 'core/paragraph', frecency: 1 },
],
possibleBlockTransformations: [],
} ) );
const wrapper = shallow( <BlockSwitcher /> );
expect( wrapper ).toMatchSnapshot();
Expand All @@ -129,7 +126,7 @@ describe( 'BlockSwitcher', () => {
test( 'should render enabled block switcher with multi block when transforms exist', () => {
useSelect.mockImplementation( () => ( {
blocks: [ headingBlock1, headingBlock2 ],
inserterItems: [
possibleBlockTransformations: [
{ name: 'core/heading', frecency: 1 },
{ name: 'core/paragraph', frecency: 1 },
],
Expand All @@ -142,12 +139,8 @@ describe( 'BlockSwitcher', () => {
beforeAll( () => {
useSelect.mockImplementation( () => ( {
blocks: [ headingBlock1 ],
inserterItems: [
{ name: 'core/quote', frecency: 1 },
{ name: 'core/cover-image', frecency: 2 },
possibleBlockTransformations: [
{ name: 'core/paragraph', frecency: 3 },
{ name: 'core/heading', frecency: 4 },
{ name: 'core/text', frecency: 5 },
],
} ) );
} );
Expand Down

0 comments on commit a8e1818

Please sign in to comment.