@@ -288,14 +288,20 @@ Item {
288288 }
289289
290290 function assertFocusOnIndex(index) {
291− var launcherListView = findChild(launcher, "launcherListView");
292− var bfbFocusHighlight = findChild(launcher, "bfbFocusHighlight");
293−
294− waitForRendering(launcher);
291+ var launcherPanel = findChild(launcherLoader.item, "launcherPanel");
292+ var launcherListView = findChild(launcherLoader.item, "launcherListView");
293+ var bfbFocusHighlight = findChild(launcherLoader.item, "bfbFocusHighlight");
294+ waitForRendering(launcherLoader.item);
295+ tryCompare(launcherPanel, "highlightIndex", index);
295296 tryCompare(bfbFocusHighlight, "visible", index === -1);
296297 for (var i = 0; i < launcherListView.count; i++) {
297− var focusRing = findChild(findChild(launcher, "launcherDelegate" + i), "focusRing")
298− tryCompare(focusRing, "visible", index === i);
298+ var item = findChild(launcher, "launcherDelegate" + i);
299+ // Delegates might be destroyed when not visible. We can't check if they paint a focus highlight.
300+ // Make sure the requested index does have focus. for the others, try best effort to check if they don't
301+ if (index === i || item) {
302+ var focusRing = findChild(item, "focusRing")
303+ tryCompare(focusRing, "visible", index === i);
304+ }
299305 }
300306 }
301307
@@ -1090,7 +1096,6 @@ Item {
10901096 var last = launcherListView.count - 1;
10911097
10921098 compare(bfbFocusHighlight.visible, false);
1093−
10941099 launcher.openForKeyboardNavigation();
10951100
10961101 assertFocusOnIndex(-1);
@@ -1113,6 +1118,7 @@ Item {
11131118
11141119 // The list should wrap around
11151120 keyClick(Qt.Key_Up);
1121+ waitForRendering(launcher);
11161122 assertFocusOnIndex(last);
11171123
11181124 keyClick(Qt.Key_Down);
@@ -1145,6 +1151,9 @@ Item {
11451151 // Go bar to top by wrapping around
11461152 keyClick(Qt.Key_Down);
11471153 assertFocusOnIndex(1);
1154+
1155+ keyClick(Qt.Key_Enter);
1156+ assertFocusOnIndex(-2);
11481157 }
11491158
11501159 function test_selectQuicklistItemByKeyboard() {