Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
-
None
Description
This failure is happening because the tests assume that battery status wouldn't change between mocks, when event listener is added, but it actually changes back to 100% on windows phone 8.1:
navigator.battery._status({ level : 5, isPlugged : false }); window.addEventListener("batterylow", onEvent, false); navigator.battery._status({ level: 20, isPlugged: false });
Event listener should be added before first mock so that windows wouldn't have the time to change the battery status in between mocks.