2021-06-24 13:40:54 -04:00
|
|
|
import { module, test } from 'qunit';
|
|
|
|
|
import { setupRenderingTest } from 'ember-qunit';
|
|
|
|
|
import { render } from '@ember/test-helpers';
|
|
|
|
|
import { hbs } from 'ember-cli-htmlbars';
|
|
|
|
|
|
|
|
|
|
module('Integration | Helper | raw-json', function (hooks) {
|
|
|
|
|
setupRenderingTest(hooks);
|
|
|
|
|
|
|
|
|
|
test('it renders', async function (assert) {
|
|
|
|
|
this.set('inputValue', {});
|
|
|
|
|
await render(hbs`{{raw-json inputValue}}`);
|
2022-07-07 11:18:51 -07:00
|
|
|
assert.strictEqual(this.element.textContent.trim(), '{}');
|
2021-06-24 13:40:54 -04:00
|
|
|
this.set('inputValue', { key: 'value', nestedKey: { key: 'value' } });
|
2022-07-07 11:18:51 -07:00
|
|
|
assert.strictEqual(
|
2021-06-24 13:40:54 -04:00
|
|
|
this.element.textContent.trim(),
|
|
|
|
|
`{\n "key": "value",\n "nestedKey": {\n "key": "value"\n }\n}`
|
|
|
|
|
);
|
|
|
|
|
});
|
|
|
|
|
});
|