import hbs from 'htmlbars-inline-precompile'; import {describe, it} from 'mocha'; import {expect} from 'chai'; import {render} from '@ember/test-helpers'; import {setupRenderingTest} from 'ember-mocha'; describe('Integration: Helper: sanitize-html', function () { setupRenderingTest(); it('renders html', async function () { this.set('inputValue', 'bold'); await render(hbs`{{{sanitize-html inputValue}}}`); expect(this.element).to.have.trimmed.html('bold'); }); it('replaces scripts', async function () { this.set('inputValue', ''); await render(hbs`{{{sanitize-html inputValue}}}`); expect(this.element).to.have.trimmed.html('
Embedded JavaScript
'); }); });