Fix saving class name attributes for divider and custom html blocks

[MAILPOET-2746]
This commit is contained in:
Rostislav Wolny
2020-03-18 09:30:39 +01:00
committed by Veljko V
parent 162b968f09
commit e9c3049576
2 changed files with 15 additions and 2 deletions

View File

@@ -176,7 +176,7 @@ describe('Blocks to Form Body', () => {
expect(divider.id).to.be.equal('divider');
expect(divider.name).to.be.equal('Divider');
expect(divider.type).to.be.equal('divider');
expect(divider.params).to.be.equal('');
expect(divider.params).to.deep.equal({ class_name: null });
});
it('Should map multiple dividers', () => {
@@ -447,6 +447,16 @@ describe('Blocks to Form Body', () => {
const [mappedEmail] = formBlocksToBody([email]);
expect(mappedEmail.params.class_name).to.be.equal('my-class-3');
const divider = { ...dividerBlock };
divider.attributes.className = 'my-class-4';
const [mappedDivider] = formBlocksToBody([divider]);
expect(mappedDivider.params.class_name).to.be.equal('my-class-4');
const html = { ...customHtmlBlock };
html.attributes.className = 'my-class-5';
const [mappedHtml] = formBlocksToBody([html]);
expect(mappedHtml.params.class_name).to.be.equal('my-class-5');
const customField = {
created_at: '2019-12-10T15:05:06+00:00',
id: 1,