Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Fix unit tests
  • Loading branch information
ellatrix committed Sep 19, 2022
commit 7069bdb555daf22e39c5ebd6447cc3b0bcefc48c
3 changes: 3 additions & 0 deletions packages/blocks/src/api/test/children.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ describe( 'concat', () => {
}
);

expect( console ).toHaveWarned();
expect( result ).toEqual( [
{
type: 'strong',
Expand Down Expand Up @@ -109,6 +110,7 @@ describe( 'toHTML', () => {

const html = toHTML( children );

expect( console ).toHaveWarned();
expect( html ).toBe( 'This is a <strong>test</strong>!' );
} );
} );
Expand All @@ -121,6 +123,7 @@ describe( 'fromDOM', () => {

const blockNode = fromDOM( node.childNodes );

expect( console ).toHaveWarned();
expect( blockNode ).toEqual( [
'This ',
{
Expand Down
3 changes: 1 addition & 2 deletions packages/blocks/src/api/test/factory.js
Original file line number Diff line number Diff line change
Expand Up @@ -340,9 +340,8 @@ describe( 'block factory', () => {
includesFalseyDefault: 0,
align: 'left',
isDifferent: true,
content: '',
defaultContent: 'test',
unknownDefaultContent: '',
unknownDefaultContent: 1,
htmlContent: 'test',
} );
expect( clonedBlock.innerBlocks ).toHaveLength( 1 );
Expand Down
3 changes: 3 additions & 0 deletions packages/blocks/src/api/test/matchers.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ describe( 'matchers', () => {
it( 'should return a source function', () => {
const source = sources.children();

expect( console ).toHaveWarned();
expect( typeof source ).toBe( 'function' );
} );

Expand All @@ -28,6 +29,7 @@ describe( 'matchers', () => {
'<blockquote><p>A delicious sundae dessert</p></blockquote>';
const match = parse( html, sources.children() );

expect( console ).toHaveWarned();
expect( renderToString( match ) ).toBe( html );
} );
} );
Expand All @@ -36,6 +38,7 @@ describe( 'matchers', () => {
it( 'should return a source function', () => {
const source = sources.node();

expect( console ).toHaveWarned();
expect( typeof source ).toBe( 'function' );
} );

Expand Down
3 changes: 3 additions & 0 deletions packages/blocks/src/api/test/node.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ describe( 'toHTML', () => {

const html = toHTML( blockNode );

expect( console ).toHaveWarned();
expect( html ).toBe(
'<strong class="is-extra-strong">This is a test</strong>'
);
Expand All @@ -42,6 +43,7 @@ describe( 'fromDOM', () => {

const blockNode = fromDOM( node );

expect( console ).toHaveWarned();
expect( blockNode ).toBe( 'Hello world' );
} );

Expand All @@ -58,6 +60,7 @@ describe( 'fromDOM', () => {

const blockNode = fromDOM( node );

expect( console ).toHaveWarned();
expect( blockNode ).toEqual( {
type: 'strong',
props: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"attributes": {
"url": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAACklEQVR4nGMAAQAABQABDQottAAAAABJRU5ErkJggg==",
"alt": "title",
"caption": [],
"caption": "",
"id": 1,
"linkDestination": "none"
},
Expand All @@ -28,7 +28,7 @@
"attributes": {
"url": "data:image/jpeg;base64,/9j/2wBDAAMCAgICAgMCAgIDAwMDBAYEBAQEBAgGBgUGCQgKCgkICQkKDA8MCgsOCwkJDRENDg8QEBEQCgwSExIQEw8QEBD/yQALCAABAAEBAREA/8wABgAQEAX/2gAIAQEAAD8A0s8g/9k=",
"alt": "title",
"caption": [],
"caption": "",
"id": 2,
"linkDestination": "none"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"attributes": {
"url": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAACklEQVR4nGMAAQAABQABDQottAAAAABJRU5ErkJggg==",
"alt": "title",
"caption": [],
"caption": "",
"linkDestination": "none"
},
"innerBlocks": []
Expand All @@ -26,7 +26,7 @@
"attributes": {
"url": "data:image/jpeg;base64,/9j/2wBDAAMCAgICAgMCAgIDAwMDBAYEBAQEBAgGBgUGCQgKCgkICQkKDA8MCgsOCwkJDRENDg8QEBEQCgwSExIQEw8QEBD/yQALCAABAAEBAREA/8wABgAQEAX/2gAIAQEAAD8A0s8g/9k=",
"alt": "title",
"caption": [],
"caption": "",
"linkDestination": "none"
},
"innerBlocks": []
Expand Down