Files
threshold-ui/addons/rose/tests/integration/components/rose/code-editor-test.js
T
Zhihe Li b722fa361b * feat: 🎸 Add code-editor component (#1207)
* feat: 🎸 Add code-editor component

Added code editor component which was taken from HCP, tweaked styles and
imports to use boundary assets

✅ Closes: ICU-5167
2022-07-29 17:18:07 -04:00

28 lines
906 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 | Component | rose/code-editor', function (hooks) {
setupRenderingTest(hooks);
test('it renders', async function (assert) {
const codeValue = 'export HCP_CLIENT_ID = {place your client_id here}';
this.set('codeValue', codeValue);
await render(hbs`
<Rose::CodeEditor
@codeValue={{this.codeValue}}
as |c|
>
<c.toolbar />
<c.fieldEditor />
</Rose::CodeEditor>
`);
assert.dom('[data-test-code-editor]').isVisible();
assert.dom('[data-test-code-editor-toolbar]').isVisible();
assert.dom('[data-test-code-editor-field-editor]').isVisible();
assert.dom('[data-test-code-editor-field-editor]').includesText(codeValue);
});
});