Skip to content

Commit

Permalink
Add unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
youknowriad committed Jul 4, 2024
1 parent 9d37f25 commit 51c6659
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions packages/blocks/src/api/test/serializer.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,30 @@ describe( 'block serializer', () => {

expect( attributes ).toEqual( { fruit: 'bananas' } );
} );

it( 'should ingore local attributes', () => {
const attributes = getCommentAttributes(
{
attributes: {
blob: {
type: 'string',
__experimentalRole: 'local',
},
url: {
type: 'string',
},
},
},
{
blob: 'blob://false-url.com',
url: 'http://real-url.com',
}
);

expect( attributes ).toEqual( {
url: 'http://real-url.com',
} );
} );
} );

describe( 'serializeAttributes()', () => {
Expand Down

0 comments on commit 51c6659

Please sign in to comment.