11const chai = require ( 'chai' )
22const { load } = require ( 'cheerio' )
33const mjml = require ( '../lib' )
4+ const { extractStyle } = require ( './utils' )
45
56describe ( 'mj-column border-radius' , function ( ) {
6- it ( 'should render correct border-radius / inner-border-radius (and border-collapse) in CSS style values on mj-column' , function ( ) {
7+ it ( 'should render correct border-radius / inner-border-radius (and border-collapse) in CSS style values on mj-column' , async function ( ) {
78 const input = `
89 <mjml>
910 <mj-body>
@@ -16,7 +17,7 @@ describe('mj-column border-radius', function () {
1617 </mjml>
1718 `
1819
19- const { html } = mjml ( input )
20+ const { html } = await mjml ( input )
2021
2122 const $ = load ( html )
2223
@@ -27,9 +28,8 @@ describe('mj-column border-radius', function () {
2728 '.mj-column-per-100 > table > tbody > tr > td, .mj-column-per-100 > table > tbody > tr > td > table' ,
2829 )
2930 . map ( function getAttr ( ) {
30- const start = $ ( this ) . attr ( 'style' ) . indexOf ( 'border-radius:' ) + 14
31- const end = $ ( this ) . attr ( 'style' ) . indexOf ( ';' , start )
32- return $ ( this ) . attr ( 'style' ) . substring ( start , end )
31+ const style = $ ( this ) . attr ( 'style' )
32+ return extractStyle ( style , 'border-radius' )
3333 } )
3434 . get ( ) ,
3535 'Border-radius / inner-border-radius in CSS style values on mj-column' ,
@@ -43,9 +43,8 @@ describe('mj-column border-radius', function () {
4343 '.mj-column-per-100 > table > tbody > tr > td, .mj-column-per-100 > table > tbody > tr > td > table' ,
4444 )
4545 . map ( function getAttr ( ) {
46- const start = $ ( this ) . attr ( 'style' ) . indexOf ( 'border-collapse:' ) + 16
47- const end = $ ( this ) . attr ( 'style' ) . indexOf ( ';' , start )
48- return $ ( this ) . attr ( 'style' ) . substring ( start , end )
46+ const style = $ ( this ) . attr ( 'style' )
47+ return extractStyle ( style , 'border-collapse' )
4948 } )
5049 . get ( ) ,
5150 'Border-collapse in CSS style values on mj-column' ,
0 commit comments