From 024fec9626c1178dc8c33cae74fca8d00eea17a2 Mon Sep 17 00:00:00 2001 From: Dharini Date: Wed, 11 Dec 2024 14:40:38 -0800 Subject: [PATCH] =?UTF-8?q?fix:=20=F0=9F=90=9B=20test?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ✅ Closes: https://hashicorp.atlassian.net/browse/ICU-15854 --- .../projects/sessions/session-test.js | 32 +++++++------------ 1 file changed, 12 insertions(+), 20 deletions(-) diff --git a/ui/desktop/tests/acceptance/projects/sessions/session-test.js b/ui/desktop/tests/acceptance/projects/sessions/session-test.js index aa3a6f8e97..0325fecfd5 100644 --- a/ui/desktop/tests/acceptance/projects/sessions/session-test.js +++ b/ui/desktop/tests/acceptance/projects/sessions/session-test.js @@ -6,7 +6,7 @@ /* global QUnit */ import { module, test } from 'qunit'; -import { visit, currentURL, click, find } from '@ember/test-helpers'; +import { visit, currentURL, click } from '@ember/test-helpers'; import { setupApplicationTest } from 'ember-qunit'; import setupMirage from 'ember-cli-mirage/test-support/setup-mirage'; import { Response } from 'miragejs'; @@ -205,23 +205,17 @@ module('Acceptance | projects | sessions | session', function (hooks) { assert.dom('.secret-container:nth-of-type(1)').includesText('backslash'); await click('.secret-container:nth-of-type(1) .hds-icon'); const expectedOutput = String.raw`password\with\tslash`; - assert.strictEqual( - find( - '.secret-container:nth-of-type(1) .secret-content', - ).textContent.trim(), - expectedOutput, - ); + assert + .dom('.secret-container:nth-of-type(1) .secret-content') + .hasText(expectedOutput); + assert .dom('.secret-container:nth-of-type(2)') .includesText('email.address'); await click('.secret-container:nth-of-type(2) .hds-icon'); - - assert.strictEqual( - find( - '.secret-container:nth-of-type(2) .secret-content', - ).textContent.trim(), - 'test.com', - ); + assert + .dom('.secret-container:nth-of-type(2) .secret-content') + .hasText('test.com'); }); test('visiting session with static type credentials should display nested data in a key/value format without escape characters', async function (assert) { @@ -267,12 +261,10 @@ module('Acceptance | projects | sessions | session', function (hooks) { .dom('.secret-container:nth-of-type(1)') .includesText('nested_secret.complex_nest.blackslash'); await click('.secret-container:nth-of-type(1) .hds-icon'); - assert.strictEqual( - find( - '.secret-container:nth-of-type(1) .secret-content', - ).textContent.trim(), - expectedOutput, - ); + + assert + .dom('.secret-container:nth-of-type(1) .secret-content') + .hasText(expectedOutput); }); test('visiting a session that does not have permissions to read a host', async function (assert) {