File tree Expand file tree Collapse file tree 1 file changed +36
-0
lines changed
packages/blocks/src/api/raw-handling/test Expand file tree Collapse file tree 1 file changed +36
-0
lines changed Original file line number Diff line number Diff line change @@ -191,4 +191,40 @@ describe( 'getBlockContentSchema', () => {
191
191
output
192
192
) ;
193
193
} ) ;
194
+
195
+ it ( 'should handle properly merging of classes and attributes' , ( ) => {
196
+ const transforms = deepFreeze ( [
197
+ {
198
+ blockName : 'my/preformatted' ,
199
+ type : 'raw' ,
200
+ schema : {
201
+ pre : {
202
+ attributes : [ 'data-chicken' ] ,
203
+ children : myContentSchema ,
204
+ } ,
205
+ } ,
206
+ } ,
207
+ {
208
+ blockName : 'core/preformatted' ,
209
+ type : 'raw' ,
210
+ schema : {
211
+ pre : {
212
+ attributes : [ 'data-ribs' , 'class' ] ,
213
+ children : myContentSchema ,
214
+ classes : [ 'my-class' , 'another-class' ] ,
215
+ } ,
216
+ } ,
217
+ } ,
218
+ ] ) ;
219
+ const output = {
220
+ pre : {
221
+ children : myContentSchema ,
222
+ attributes : [ 'data-chicken' , 'data-ribs' , 'class' ] ,
223
+ classes : [ 'my-class' , 'another-class' ] ,
224
+ } ,
225
+ } ;
226
+ expect ( getBlockContentSchemaFromTransforms ( transforms ) ) . toEqual (
227
+ output
228
+ ) ;
229
+ } ) ;
194
230
} ) ;
You can’t perform that action at this time.
0 commit comments