Files
threshold-ui/ui/desktop/tests/integration/components/settings-card/server-test.js
T
55e1e68f30 [COMPLIANCE] Update Copyright and License Headers (#3099)
Co-authored-by: hashicorp-copywrite[bot] <110428419+hashicorp-copywrite[bot]@users.noreply.github.com>
Co-authored-by: Dharini <dharini@hashicorp.com>
2026-01-20 11:35:10 -05:00

41 lines
1.4 KiB
JavaScript

/**
* Copyright IBM Corp. 2021, 2025
* 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');
const setDefaultClusterUrl = (test) => {
const windowOrigin = 'hashicorp.cloud';
const clusterUrl = test.owner.lookup('service:clusterUrl');
clusterUrl.rendererClusterUrl = windowOrigin;
};
setDefaultClusterUrl(this);
test('it displays HCP cluster url in server information section', async function (assert) {
await render(hbs`<SettingsCard::Server/>`);
assert.dom(SERVER_NAME).hasText('HashiCorp Cloud Platform');
assert.dom(SERVER_URL).hasText('hashicorp.cloud');
});
test('it displays non HCP cluster url in server information section', async function (assert) {
this.owner.lookup('service:clusterUrl').rendererClusterUrl =
'everythingelse';
await render(hbs`<SettingsCard::Server/>`);
assert.dom(SERVER_NAME).hasText('Self-Managed');
assert.dom(SERVER_URL).hasText('everythingelse');
});
});