moved delay simulation to the mock handler

This commit is contained in:
JesmoDev
2022-06-01 16:38:56 +02:00
parent 26b808f843
commit 1f015d082f
2 changed files with 4 additions and 7 deletions

View File

@@ -30,12 +30,7 @@ export class UmbInstallerContext {
}
public requestInstall() {
return new Promise((resolve, reject) => {
setTimeout(() => {
// simulate 2 sec delay
postInstall(this._data.getValue()).then(resolve, reject);
}, 2000);
});
return postInstall(this._data.getValue());
}
private loadIntallerSettings() {

View File

@@ -71,7 +71,9 @@ export const handlers = [
);
}),
rest.post<UmbracoPerformInstallRequest>('/umbraco/backoffice/install', (req, res, ctx) => {
rest.post<UmbracoPerformInstallRequest>('/umbraco/backoffice/install', async (req, res, ctx) => {
await new Promise((resolve) => setTimeout(resolve, (Math.random() + 1) * 1000)); // simulate a delay of 1-2 seconds
if (req.body.database.databaseName === 'fail') {
return res(
// Respond with a 200 status code