@@ -1619,5 +1619,38 @@ Rectangle {
16191619 waitForRendering(launcherPanel);
16201620 compare(launcherPanel.visible, true);
16211621 }
1622+
1623+ // Regression test for https://github.com/ubports/unity8/issues/361
1624+ // After introduction of the app drawer, the peeking animation was
1625+ // still being used while the drawer is open, causing the launcher
1626+ // to be hidden, and in some cases not reappear. Ensure that instead
1627+ // of the peeking animation, we use the wiggle here.
1628+ function test_peekNotRunWhenDrawerOpen() {
1629+ var launcherPanel = findChild(launcher, "launcherPanel");
1630+ verify(launcherPanel);
1631+ var peekingAnimation = findInvisibleChild(launcherPanel, "peekingAnimation5");
1632+ verify(peekingAnimation);
1633+ var appIcon5 = findChild(launcher, "launcherDelegate5")
1634+ verify(appIcon5 !== undefined);
1635+
1636+ startedSpy.target = peekingAnimation;
1637+
1638+ // Open the drawer and wait for the launcher to be rendered
1639+ launcher.toggleDrawer(false, true)
1640+ waitForRendering(launcherPanel);
1641+ tryCompare(launcherPanel, "visible", true, 5000, "Launcher should be visible");
1642+ tryCompare(launcher, "state", "drawer");
1643+
1644+ // Verify the wiggle happens
1645+ LauncherModel.setAlerting(LauncherModel.get(5).appId, true);
1646+ tryCompare(appIcon5, "alerting", true);
1647+ LauncherModel.setAlerting(LauncherModel.get(5).appId, false);
1648+ tryCompare(appIcon5, "alerting", false);
1649+
1650+ // Ensure peekingAnimation was not started
1651+ compare(startedSpy.count, 0);
1652+ // Ensure launcher remains visible
1653+ tryCompare(launcherPanel, "visible", true, 5000, "Launcher should remain visible");
1654+ }
16221655 }
16231656}