[Desktop][Bug fix]: Stop target sessions before unauthenticating user session (#2891)

* add stopAll invocation to ipc handler

* trigger modal on both signout btns

* refactor invalidateSession fn

* fix application controller tests

* fix failing tests settings-card/user

* add test to Acceptance | authentication

* migrate electron dialog.showMessageBoxSync to Hds

* rename channel and tracked prop, consolidate cancel fns

* combine modals, add willDestroy, refactor

* test signout and close sessions modal

* address feedback

* refactor window.electron in authentication-test

* address feedback

* refactor: 💡 Fix failing tests

---------

Co-authored-by: Zhihe Li <zhihe.li@hashicorp.com>
This commit is contained in:
LaurenandZhihe Li authored and GitHub committed 2025-08-04 16:44:27 -04:00
1 parent f776ba0617
commit 990e2d6b9d
20 files changed
+342 -84

No files matched your search

@@ -12,9 +12,9 @@ module('Unit | Controller | application', function (hooks) {
setupTest(hooks);
let controller;
let session;
let clusterUrl;
let mockIPC;
let session;
const setupMockIpc = (test) => {
test.owner.register('service:browser/window', WindowMockIPC);
@@ -23,10 +23,10 @@ module('Unit | Controller | application', function (hooks) {
hooks.beforeEach(async function () {
await authenticateSession({});
setupMockIpc(this);
controller = this.owner.lookup('controller:application');
session = this.owner.lookup('service:session');
clusterUrl = this.owner.lookup('service:cluster-url');
setupMockIpc(this);
});
test('it exists', function (assert) {
@@ -34,14 +34,8 @@ module('Unit | Controller | application', function (hooks) {
assert.ok(controller.minimize);
assert.ok(controller.toggleFullScreen);
assert.ok(controller.close);
});
test('invalidateSession action de-authenticates a user', async function (assert) {
assert.true(session.isAuthenticated);
await controller.invalidateSession();
assert.false(session.isAuthenticated);
assert.ok(controller.confirmCloseSessions);
assert.ok(controller.showModalOrLogout);
});
test('toggleTheme action sets theme to specified value', function (assert) {