From ae66e68bad66d92e0b41a3c1367711e03f230166 Mon Sep 17 00:00:00 2001 From: Devon Anderson Date: Thu, 30 Mar 2023 08:29:52 -0400 Subject: [PATCH] =?UTF-8?q?chore:=20=F0=9F=A4=96=20add=20related=20test=20?= =?UTF-8?q?for=20target=20sidebar=20(#166)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore: 🤖 add related test for target sidebar Add related acceptance test for `session-recording` sidebar integration into `target` form. ✅ Closes: ICU-8590 * Update read-test.js * refactor: 💡 fix test Fix failing test for sidebar component. * Update ui/admin/tests/acceptance/targets/read-test.js Co-authored-by: Zhihe Li * Update ui/admin/tests/acceptance/targets/read-test.js Co-authored-by: Zhihe Li --------- Co-authored-by: Zhihe Li --- .../tests/acceptance/targets/read-test.js | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/ui/admin/tests/acceptance/targets/read-test.js b/ui/admin/tests/acceptance/targets/read-test.js index e6205e150..76c054a0d 100644 --- a/ui/admin/tests/acceptance/targets/read-test.js +++ b/ui/admin/tests/acceptance/targets/read-test.js @@ -38,6 +38,7 @@ module('Acceptance | targets | read', function (hooks) { targets: null, sshTarget: null, tcpTarget: null, + enableSessionRecording: null, }; hooks.beforeEach(function () { @@ -68,6 +69,7 @@ module('Acceptance | targets | read', function (hooks) { urls.sshTarget = `${urls.targets}/${instances.sshTarget.id}`; urls.tcpTarget = `${urls.targets}/${instances.tcpTarget.id}`; urls.unknownTarget = `${urls.targets}/foo`; + urls.enableSessionRecording = `${urls.sshTarget}/enable-session-recording`; authenticateSession({}); }); @@ -190,4 +192,22 @@ module('Acceptance | targets | read', function (hooks) { .dom(`[href="https://boundaryproject.io/help/admin-ui/targets"]`) .exists(); }); + + test('users can click on enable-recording button in target session-recording sidebar and it takes them to enable session recording', async function (assert) { + assert.expect(1); + + await visit(urls.sshTarget); + + await click('.target-sidebar a'); + assert.strictEqual(currentURL(), urls.enableSessionRecording); + }); + + test('users can click on settings icon in target session-recording sidebar and it takes them to enable session recording', async function (assert) { + assert.expect(1); + + await visit(urls.sshTarget); + + await click('.target-sidebar .title-wrapper a'); + assert.strictEqual(currentURL(), urls.enableSessionRecording); + }); });