on xenial help sign in
Add more tests
d8139b6Josh Arenson
qml/Greeter/LoginList.qml+1
@@ -107,6 +107,7 @@ Item {
107 // Use an AbstractButton due to icon limitations with Button
107 // Use an AbstractButton due to icon limitations with Button
108 AbstractButton {
108 AbstractButton {
109 id: sessionChooser
109 id: sessionChooser
110+ objectName: "sessionChooserButton"
110
111
111 visible: LightDMService.sessions.count > 1
112 visible: LightDMService.sessions.count > 1
112
113
tests/qmltests/Greeter/tst_WideView.qml+17
@@ -318,6 +318,7 @@ Item {
318 respondedSpy.clear();
318 respondedSpy.clear();
319 teaseSpy.clear();
319 teaseSpy.clear();
320 emergencySpy.clear();
320 emergencySpy.clear();
321+ LightDM.Sessions.testScenario = "multipleSessions"
321 }
322 }
322
323
323 function cleanup() {
324 function cleanup() {
@@ -374,9 +375,25 @@ Item {
374 ]
375 ]
375 }
376 }
376
377
378+ function test_noSessionsDoesntBreakView() {
379+ LightDM.Sessions.testScenario = "noSessions"
380+ compare(LightDM.Sessions.count, 0)
381+ }
382+
377 function test_sessionIconNotShownWithOneSession() {
383 function test_sessionIconNotShownWithOneSession() {
378 LightDM.Sessions.testScenario = "singleSession"
384 LightDM.Sessions.testScenario = "singleSession"
379 compare(LightDM.Sessions.count, 1);
385 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);
380 }
397 }
381
398
382 function test_tease(data) {
399 function test_tease(data) {