Files
threshold-ui/ui/desktop/tests/integration/components/settings-card/server-test.js
T

32 lines
1.2 KiB
JavaScript
Raw Normal View History

/**
2026-01-28 17:09:06 -08:00
* Copyright IBM Corp. 2021, 2026
* SPDX-License-Identifier: BUSL-1.1
*/
import { module, test } from 'qunit';
import { setupRenderingTest } from 'ember-qunit';
import { render } from '@ember/test-helpers';
import { hbs } from 'ember-cli-htmlbars';
import { setupIntl } from 'ember-intl/test-support';
const SERVER_NAME = '[data-test-server-name]';
const SERVER_URL = '[data-test-server-url]';
module('Integration | Component | settings-card/server', function (hooks) {
setupRenderingTest(hooks);
setupIntl(hooks, 'en-us');
test('it displays HCP cluster url in server information section', async function (assert) {
2026-05-20 16:36:16 -04:00
this.set('model', { serverInformation: 'boundary.hashicorp.cloud' });
await render(hbs`<SettingsCard::Server @model={{this.model}}/>`);
assert.dom(SERVER_NAME).hasText('HashiCorp Cloud Platform');
2026-05-20 16:36:16 -04:00
assert.dom(SERVER_URL).hasText('boundary.hashicorp.cloud');
});
test('it displays non HCP cluster url in server information section', async function (assert) {
2026-05-20 16:36:16 -04:00
this.set('model', { serverInformation: 'everythingelse' });
await render(hbs`<SettingsCard::Server @model={{this.model}}/>`);
assert.dom(SERVER_NAME).hasText('Self-managed');
assert.dom(SERVER_URL).hasText('everythingelse');
});
});