Store columns text and background colors settings
[MAILPOET-2609]
This commit is contained in:
committed by
Pavel Dohnal
parent
c93efabc70
commit
8e71f8d3cc
@ -161,7 +161,6 @@ export const customHtmlBlock = {
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
export const nestedColumns = {
|
||||
clientId: 'columns-1',
|
||||
name: 'core/columns',
|
||||
|
@ -338,4 +338,19 @@ describe('Blocks to Form Body', () => {
|
||||
const input = column11.body[0];
|
||||
checkBodyInputBasics(input);
|
||||
});
|
||||
|
||||
it('Should map colors for columns', () => {
|
||||
const columns = { ...nestedColumns };
|
||||
columns.attributes = {
|
||||
textColor: 'vivid-red',
|
||||
backgroundColor: 'white',
|
||||
customBackgroundColor: '#ffffff',
|
||||
customTextColor: '#dd0000',
|
||||
};
|
||||
const [mapped] = formBlocksToBody([columns]);
|
||||
expect(mapped.params.text_color).to.be.equal('vivid-red');
|
||||
expect(mapped.params.background_color).to.be.equal('white');
|
||||
expect(mapped.params.custom_background_color).to.be.equal('#ffffff');
|
||||
expect(mapped.params.custom_text_color).to.be.equal('#dd0000');
|
||||
});
|
||||
});
|
||||
|
@ -340,4 +340,19 @@ describe('Form Body To Blocks', () => {
|
||||
const column12 = columns11.innerBlocks[1];
|
||||
expect(column12.innerBlocks.length).to.be.equal(0);
|
||||
});
|
||||
|
||||
it('Should map columns colors', () => {
|
||||
const nested = { ...nestedColumns, position: '1' };
|
||||
nested.params = {
|
||||
text_color: 'vivid-red',
|
||||
background_color: 'white',
|
||||
custom_text_color: '#dd0000',
|
||||
custom_background_color: '#ffffff',
|
||||
};
|
||||
const [block] = formBodyToBlocks([nested]);
|
||||
expect(block.attributes.textColor).to.be.equal('vivid-red');
|
||||
expect(block.attributes.backgroundColor).to.be.equal('white');
|
||||
expect(block.attributes.customTextColor).to.be.equal('#dd0000');
|
||||
expect(block.attributes.customBackgroundColor).to.be.equal('#ffffff');
|
||||
});
|
||||
});
|
||||
|
Reference in New Issue
Block a user