Store columns block custom class name
[MAILPOET-2609]
This commit is contained in:
committed by
Pavel Dohnal
parent
8e71f8d3cc
commit
b51ce7c1b2
@ -353,4 +353,20 @@ describe('Blocks to Form Body', () => {
|
||||
expect(mapped.params.custom_background_color).to.be.equal('#ffffff');
|
||||
expect(mapped.params.custom_text_color).to.be.equal('#dd0000');
|
||||
});
|
||||
|
||||
it('Should map class name for columns and column', () => {
|
||||
const columns = { ...nestedColumns };
|
||||
columns.attributes = {
|
||||
className: 'my-class',
|
||||
};
|
||||
const [mapped] = formBlocksToBody([columns]);
|
||||
expect(mapped.params.class_name).to.be.equal('my-class');
|
||||
|
||||
const column = { ...nestedColumns.innerBlocks[0] };
|
||||
column.attributes = {
|
||||
className: 'my-class-2',
|
||||
};
|
||||
const [mappedColumn] = formBlocksToBody([column]);
|
||||
expect(mappedColumn.params.class_name).to.be.equal('my-class-2');
|
||||
});
|
||||
});
|
||||
|
@ -355,4 +355,13 @@ describe('Form Body To Blocks', () => {
|
||||
expect(block.attributes.customTextColor).to.be.equal('#dd0000');
|
||||
expect(block.attributes.customBackgroundColor).to.be.equal('#ffffff');
|
||||
});
|
||||
|
||||
it('Should map class name', () => {
|
||||
const nested = { ...nestedColumns, position: '1' };
|
||||
nested.params = {
|
||||
class_name: 'custom-class',
|
||||
};
|
||||
const [block] = formBodyToBlocks([nested]);
|
||||
expect(block.attributes.className).to.be.equal('custom-class');
|
||||
});
|
||||
});
|
||||
|
Reference in New Issue
Block a user