From 51c66592bf6a1550b5626d69e3de1637a5bd9a46 Mon Sep 17 00:00:00 2001 From: Riad Benguella Date: Thu, 4 Jul 2024 09:08:18 +0200 Subject: [PATCH] Add unit test --- packages/blocks/src/api/test/serializer.js | 24 ++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/packages/blocks/src/api/test/serializer.js b/packages/blocks/src/api/test/serializer.js index 6cb21470f9e1fa..7fed23041daaa6 100644 --- a/packages/blocks/src/api/test/serializer.js +++ b/packages/blocks/src/api/test/serializer.js @@ -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()', () => {