Skip to content

Commit fb62f04

Browse files
committed
test: login-desktop-integ-test.js port of the saem browser login tests
1 parent 5c86489 commit fb62f04

File tree

3 files changed

+542
-275
lines changed

3 files changed

+542
-275
lines changed

src/services/login-desktop.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -372,6 +372,7 @@ define(function (require, exports, module) {
372372
return;
373373
}
374374
await _resetAccountLogin();
375+
await _verifyLogin();
375376
Dialogs.showModalDialog(
376377
DefaultDialogs.DIALOG_ID_INFO,
377378
Strings.SIGNED_OUT,

test/spec/login-browser-integ-test.js

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -385,6 +385,12 @@ define(function (require, exports, module) {
385385
);
386386
}
387387

388+
function verifyProfileIconBlanked() {
389+
const $profileIcon = testWindow.$("#user-profile-button");
390+
const initialContent = $profileIcon.html();
391+
expect(initialContent).not.toContain('TU');
392+
}
393+
388394
async function performFullLogoutFlow() {
389395
// Click profile button to open popup
390396
const $profileButton = testWindow.$("#user-profile-button");
@@ -411,6 +417,8 @@ define(function (require, exports, module) {
411417
"User to be signed out",
412418
10000
413419
);
420+
421+
verifyProfileIconBlanked();
414422
}
415423

416424
describe("Browser Login Tests", function () {
@@ -441,14 +449,13 @@ define(function (require, exports, module) {
441449
setupProUserMock(false);
442450

443451
// Verify initial state
444-
const $profileIcon = testWindow.$("#user-profile-button");
445-
const initialContent = $profileIcon.html();
446-
expect(initialContent).not.toContain('TU');
452+
verifyProfileIconBlanked();
447453

448454
// Perform login
449455
await performFullLoginFlow();
450456

451457
// Verify profile icon updated with user initials
458+
const $profileIcon = testWindow.$("#user-profile-button");
452459
const updatedContent = $profileIcon.html();
453460
expect(updatedContent).toContain('svg');
454461
expect(updatedContent).toContain('TU');

0 commit comments

Comments
 (0)