Skip to content

Commit

Permalink
fix: πŸ› test
Browse files Browse the repository at this point in the history
  • Loading branch information
DhariniJeeva committed Dec 11, 2024
1 parent 0943456 commit 024fec9
Showing 1 changed file with 12 additions and 20 deletions.
32 changes: 12 additions & 20 deletions ui/desktop/tests/acceptance/projects/sessions/session-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 024fec9

Please sign in to comment.