diff --git a/test/test.js b/test/test.js index 6d8042b..e37d940 100644 --- a/test/test.js +++ b/test/test.js @@ -204,7 +204,12 @@ describe('Application life cycle test', function () { it('check room', checkRoom); it('restore app', function () { - execSync('cloudron restore --app ' + app.id, { cwd: path.resolve(__dirname, '..'), stdio: 'inherit' }); + const backups = JSON.parse(execSync('cloudron backup list --raw')); + execSync('cloudron uninstall --app ' + app.id, { cwd: path.resolve(__dirname, '..'), stdio: 'inherit' }); + execSync('cloudron install --location ' + LOCATION, { cwd: path.resolve(__dirname, '..'), stdio: 'inherit' }); + var inspect = JSON.parse(execSync('cloudron inspect')); + app = inspect.apps.filter(function (a) { return a.location === LOCATION; })[0]; + execSync(`cloudron restore --backup ${backups[0].id} --app ${app.id}`, { cwd: path.resolve(__dirname, '..'), stdio: 'inherit' }); }); it('check landing page', checkLandingPage);