fixes issue

This commit is contained in:
scottbommarito
2016-06-20 15:15:45 -07:00
parent 9eefb213aa
commit 46bd770219
3 changed files with 44 additions and 0 deletions

View File

@@ -0,0 +1,17 @@
var CodePushWrapper = require("../codePushWrapper.js");
import CodePush from "react-native-code-push";
module.exports = {
startTest: function(testApp) {
CodePushWrapper.checkAndInstall(testApp,
() => {
CodePush.restartApp();
CodePush.restartApp();
}
);
},
getScenarioName: function() {
return "Install and Restart 2x";
}
};

View File

@@ -465,6 +465,7 @@ const ScenarioInstall = "scenarioInstall.js";
const ScenarioInstallOnResumeWithRevert = "scenarioInstallOnResumeWithRevert.js";
const ScenarioInstallOnRestartWithRevert = "scenarioInstallOnRestartWithRevert.js";
const ScenarioInstallWithRevert = "scenarioInstallWithRevert.js";
const ScenarioInstallRestart2x = "scenarioInstallRestart2x.js";
const ScenarioSync1x = "scenarioSync.js";
const ScenarioSyncResume = "scenarioSyncResume.js";
const ScenarioSyncResumeDelay = "scenarioSyncResumeDelay.js";
@@ -986,6 +987,26 @@ PluginTestingFramework.initializeTests(new RNProjectManager(), supportedTargetPl
});
}, ScenarioRestart);
TestBuilder.describe("#codePush.restartApplication.2x",
() => {
TestBuilder.it("with pending update", false,
(done: MochaDone) => {
ServerUtil.updateResponse = { updateInfo: ServerUtil.createUpdateResponse(false, targetPlatform) };
setupUpdateScenario(projectManager, targetPlatform, UpdateDeviceReady, "Update 1")
.then<void>((updatePath: string) => {
ServerUtil.updatePackagePath = updatePath;
projectManager.runApplication(TestConfig.testRunDirectory, targetPlatform);
return ServerUtil.expectTestMessages([
ServerUtil.TestMessage.CHECK_UPDATE_AVAILABLE,
ServerUtil.TestMessage.DOWNLOAD_SUCCEEDED,
ServerUtil.TestMessage.UPDATE_INSTALLED,
ServerUtil.TestMessage.DEVICE_READY_AFTER_UPDATE]);
})
.done(() => { done(); }, (e) => { done(e); });
});
}, ScenarioInstallRestart2x);
TestBuilder.describe("#window.codePush.sync",
() => {
// We test the functionality with sync twice--first, with sync only called once,