Files
threshold-ui/ui/desktop/tests/integration/helpers/raw-json-test.js
T
Zhihe Li bcf004b8a4 Reformat codebase with trailing commas in functions (#2006)
* style: 💄 Update trailing commas in API

* style: 💄 Update trailing commas in core

* style: 💄 Update trailing commas in rose

* style: 💄 Update trailing commas in admin

* style: 💄 Update trailing commas in desktop
2023-11-22 14:07:41 -05:00

25 lines
772 B
JavaScript

/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: MPL-2.0
*/
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}`,
);
});
});