/* eslint-env es6 */ 'use strict'; const unified = require('unified'); const rehypeParse = require('rehype-parse'); const rehypeStringify = require('rehype-stringify'); const tableCellStyle = require('.'); function transformHtml(html) { return unified() .use(rehypeParse, { fragment: true }) .use(() => tableCellStyle) .use(rehypeStringify) .processSync(html).contents; } describe('transforms align to CSS text-align', () => { test('for ', () => { const actual = transformHtml('foo'); expect(actual).toBe('foo'); }); test('for that already has a style', () => { const actual = transformHtml( 'foo' ); expect(actual).toBe( 'foo' ); }); test('for ', () => { const actual = transformHtml('foo'); expect(actual).toBe('foo'); }); test('for that already has a style', () => { const actual = transformHtml( 'foo' ); expect(actual).toBe( 'foo' ); }); test('for ', () => { const actual = transformHtml('foo'); expect(actual).toBe('foo'); }); test('for that already has a style', () => { const actual = transformHtml( 'foo' ); expect(actual).toBe( 'foo' ); }); }); describe('transforms valign to CSS vertical-align', () => { test('for ', () => { const actual = transformHtml('foo'); expect(actual).toBe( 'foo' ); }); test('for that already has a style', () => { const actual = transformHtml( 'foo' ); expect(actual).toBe( 'foo' ); }); test('for ', () => { const actual = transformHtml('foo'); expect(actual).toBe('foo'); }); test('for that already has a style', () => { const actual = transformHtml( 'foo' ); expect(actual).toBe( 'foo' ); }); test('for ', () => { const actual = transformHtml('foo'); expect(actual).toBe('foo'); }); test('for that already has a style', () => { const actual = transformHtml( 'foo' ); expect(actual).toBe( 'foo' ); }); }); describe('transforms height to CSS height', () => { test('for ', () => { const actual = transformHtml('foo'); expect(actual).toBe('foo'); }); test('for that already has a style', () => { const actual = transformHtml( 'foo' ); expect(actual).toBe( 'foo' ); }); test('for ', () => { const actual = transformHtml('foo'); expect(actual).toBe('foo'); }); test('for that already has a style', () => { const actual = transformHtml( 'foo' ); expect(actual).toBe('foo'); }); test('for ', () => { const actual = transformHtml('foo'); expect(actual).toBe('foo'); }); test('for that already has a style', () => { const actual = transformHtml( 'foo' ); expect(actual).toBe('foo'); }); }); describe('transforms width to CSS width', () => { test('for ', () => { const actual = transformHtml('foo'); expect(actual).toBe('foo'); }); test('for that already has a style', () => { const actual = transformHtml( 'foo' ); expect(actual).toBe( 'foo' ); }); test('for ', () => { const actual = transformHtml('foo'); expect(actual).toBe('foo'); }); test('for that already has a style', () => { const actual = transformHtml( 'foo' ); expect(actual).toBe('foo'); }); test('for ', () => { const actual = transformHtml('foo'); expect(actual).toBe('foo'); }); test('for that already has a style', () => { const actual = transformHtml( 'foo' ); expect(actual).toBe('foo'); }); });