import { describe, it } from '@ephox/bedrock-client'; import { assert } from 'chai'; import { MediaData } from 'tinymce/plugins/media/core/Types'; import * as UpdateHtml from 'tinymce/plugins/media/core/UpdateHtml'; describe('atomic.tinymce.plugins.media.core.UpdateHtmlTest', () => { const testHtmlUpdate = (html: string, newData: Partial, updateAll: boolean, expected: string) => { const actual = UpdateHtml.updateHtml(html, newData, updateAll); assert.deepEqual(actual, expected); }; it('If not updating all, nothing new is added', () => testHtmlUpdate( '', { source: 'source1', sourcemime: 'source1mime', altsource: 'source2', altsourcemime: 'source2mime', poster: 'poster' }, false, '' )); it('If updating all, add missing sources and attributes', () => testHtmlUpdate( '', { source: 'source1', sourcemime: 'source1mime', altsource: 'source2', altsourcemime: 'source2mime', poster: 'poster' }, true, '' )); });