Files
threshold-ui/ui/admin/tests/integration/components/info-field-test.js
T
Devon Anderson 2558ee1353 chore: 🤖 Upgrading to Ember 4.12.2 (#1988)
* chore: 🤖 Upgrading to Ember 4.12.2

Upgrading `admin/ui` to Ember 4.12.2

✅ Closes: https://hashicorp.atlassian.net/browse/ICU-11330

* refactor: 💡 Removed unused package

Removed unused `stylelint` package for `css`

✅ Closes: https://hashicorp.atlassian.net/browse/ICU-11330

* refactor: 💡 removed unused dependency

Removed `stylelint-prettier` dependency

✅ Closes: https://hashicorp.atlassian.net/browse/ICU-11330
2023-11-10 11:21:52 -05:00

54 lines
1.6 KiB
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 | Component | info-field', function (hooks) {
setupRenderingTest(hooks);
hooks.beforeEach(function () {
this.set('label', 'Type');
this.set('helperText', 'Description');
});
test('it renders without icon', async function (assert) {
assert.expect(4);
await render(
hbs`
<InfoField @value="JSON" as |F|>
<F.Label>{{this.label}}</F.Label>
<F.HelperText>{{this.helperText}}</F.HelperText>
</InfoField>
`,
);
assert.dom('.info-field').isVisible();
assert.dom('.info-field .hds-form-label').hasText('Type');
assert.dom('.info-field .hds-form-helper-text').hasText('Description');
assert.dom('.info-field .hds-form-text-input').isVisible();
});
test('it renders with icon', async function (assert) {
assert.expect(5);
await render(
hbs`
<InfoField @value="JSON" @icon='apple' as |F|>
<F.Label>{{this.label}}</F.Label>
<F.HelperText>{{this.helperText}}</F.HelperText>
</InfoField>
`,
);
assert.dom('.info-field').isVisible();
assert.dom('.info-field .hds-form-label').hasText('Type');
assert.dom('.info-field .hds-form-helper-text').hasText('Description');
assert.dom('[data-test-icon="apple"]').isVisible();
assert.dom('.info-field .hds-form-text-input').isVisible();
});
});