on xenial help sign in
Add more tests
commitd8139b6b3f830d85258ea37fd7b3d56bc2cd8685 authorJosh Arenson <joshua.arenson@canonical.com> dateThu 19 Nov 2015, 15:15 (11 years ago) parent481d474
2 files changed+18
qml/Greeter/LoginList.qml+1 tests/qmltests/Greeter/tst_WideView.qml+17
qml/Greeter/LoginList.qml+1
@@ -107,6 +107,7 @@ Item {
107107 // Use an AbstractButton due to icon limitations with Button
108108 AbstractButton {
109109 id: sessionChooser
110+ objectName: "sessionChooserButton"
110111
111112 visible: LightDMService.sessions.count > 1
112113
tests/qmltests/Greeter/tst_WideView.qml+17
@@ -318,6 +318,7 @@ Item {
318318 respondedSpy.clear();
319319 teaseSpy.clear();
320320 emergencySpy.clear();
321+ LightDM.Sessions.testScenario = "multipleSessions"
321322 }
322323
323324 function cleanup() {
@@ -374,9 +375,25 @@ Item {
374375 ]
375376 }
376377
378+ function test_noSessionsDoesntBreakView() {
379+ LightDM.Sessions.testScenario = "noSessions"
380+ compare(LightDM.Sessions.count, 0)
381+ }
382+
377383 function test_sessionIconNotShownWithOneSession() {
378384 LightDM.Sessions.testScenario = "singleSession"
379385 compare(LightDM.Sessions.count, 1);
386+
387+ var sessionChooserButton = findChild(view, "sessionChooserButton");
388+ compare(sessionChooserButton.visible, false);
389+ }
390+
391+ function test_sessionIconShownWithMultipleSessions() {
392+ LightDM.Sessions.testScenario = "multipleSessions"
393+ compare(LightDM.Sessions.count > 1, true);
394+
395+ var sessionChooserButton = findChild(view, "sessionChooserButton");
396+ compare(sessionChooserButton.visible, true);
380397 }
381398
382399 function test_tease(data) {