Skip to content

Commit

Permalink
Merge pull request #2033 from WordPress/fix/new-block-invalid
Browse files Browse the repository at this point in the history
Create new blocks as valid
  • Loading branch information
aduth authored Jul 26, 2017
2 parents 834ecf5 + a1ab44d commit 073cfc4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions blocks/api/factory.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export function createBlock( name, attributes = {} ) {
return {
uid: uuid(),
name,
isValid: true,
attributes: {
...defaultAttributes,
...attributes,
Expand Down
1 change: 1 addition & 0 deletions blocks/api/test/factory.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ describe( 'block factory', () => {
includesDefault: true,
align: 'left',
} );
expect( block.isValid ).toBe( true );
expect( typeof block.uid ).toBe( 'string' );
} );
} );
Expand Down

0 comments on commit 073cfc4

Please sign in to comment.