Files
threshold-ui/ui/desktop/tests/integration/helpers/raw-json-test.js
T
c21f011bb2 Refactor upgrade ember 4 (#1501)
Upgrade Ember 4

Co-authored-by: Randall Morey <randall@randallmorey.com>
Co-authored-by: Zhihe Li <zhihe.li@hashicorp.com>
2023-01-09 08:48:49 -08:00

20 lines
693 B
JavaScript

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 this.inputValue}}`);
assert.strictEqual(this.element.textContent.trim(), '{}');
this.set('inputValue', { key: 'value', nestedKey: { key: 'value' } });
assert.strictEqual(
this.element.textContent.trim(),
`{\n "key": "value",\n "nestedKey": {\n "key": "value"\n }\n}`
);
});
});