@@ -413,19 +413,29 @@ StyledItem {
413413
414414 function test_changingSessionSticksToUser() {
415415 LightDMController.sessionMode = "full";
416+
417+ var loginList = findChild(view, "loginList");
418+ var fakeSession1 = "ASessionWillNeverBeCalledThis";
419+ var fakeSession2 = "ASessionWillAlsoNeverBeCalledThis";
420+
416421 // For this test to work, a user has to be selected and the
417422 // mock must be made aware of that user
418423 selectUser("has-password")
419424 LightDMController.currentUsername = "has-password"
425+ compare(LightDM.Sessions.count > 1, true);
426+ compare(loginList.currentSession != fakeSession1, true);
427+ LightDMController.sessionName = fakeSession1;
420428
421− var loginList = findChild(view, "loginList");
422− var fakeSessionName = "ASessionWillNeverBeCalledThis";
429+ selectUser("has-pin")
430+ LightDMController.currentUsername = "has-pin"
431+ compare(loginList.currentSession != fakeSession2, true);
432+ LightDMController.sessionName = fakeSession2;
423433
424− compare(LightDM.Sessions.count > 1, true);
425− compare(loginList.currentSession != fakeSessionName, true);
434+ selectUser("has-password")
435+ tryCompare(loginList, "currentSession", fakeSession1);
426436
427− LightDMController.sessionName = fakeSessionName;
428− tryCompare(loginList, "currentSession", fakeSessionName);
437+ selectUser("has-pin")
438+ tryCompare(loginList, "currentSession", fakeSession2);
429439
430440 // Force a model reset
431441 LightDMController.userMode = "single";