moved delay simulation to the mock handler
This commit is contained in:
@@ -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() {
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user