From effb185911ef8a5242d9a61cdb7e8af13c8fadc4 Mon Sep 17 00:00:00 2001
From: Jacob Overgaard <752371+iOvergaard@users.noreply.github.com>
Date: Tue, 2 Aug 2022 13:53:19 +0200
Subject: [PATCH] add a step for preconfigured database with mocked response
---
.../src/installer/installer.stories.ts | 40 +++++++++++++++++++
1 file changed, 40 insertions(+)
diff --git a/src/Umbraco.Web.UI.Client/src/installer/installer.stories.ts b/src/Umbraco.Web.UI.Client/src/installer/installer.stories.ts
index 8893d33acb..6abe87e64f 100644
--- a/src/Umbraco.Web.UI.Client/src/installer/installer.stories.ts
+++ b/src/Umbraco.Web.UI.Client/src/installer/installer.stories.ts
@@ -6,8 +6,10 @@ import './installer-user.element';
import { Meta, Story } from '@storybook/web-components';
import { html } from 'lit-html';
+import { rest } from 'msw';
import { UmbInstallerUser } from '.';
+import { UmbracoInstaller } from '../core/models';
import { UmbInstallerContext } from './installer-context';
export default {
@@ -49,5 +51,43 @@ Step3Database.parameters = {
},
};
+export const Step3DatabasePreconfigured: Story = () => html``;
+Step3DatabasePreconfigured.storyName = 'Step 3: Database (preconfigured)';
+Step3DatabasePreconfigured.parameters = {
+ actions: {
+ handles: ['previous', 'next'],
+ },
+ msw: {
+ handlers: {
+ global: null,
+ others: [
+ rest.get('/umbraco/backoffice/install/settings', (_req, res, ctx) => {
+ return res(
+ ctx.status(200),
+ ctx.json({
+ user: { consentLevels: [], minCharLength: 2, minNonAlphaNumericLength: 2 },
+ databases: [
+ {
+ id: '1',
+ sortOrder: -1,
+ displayName: 'SQLite',
+ defaultDatabaseName: 'Umbraco',
+ providerName: 'Microsoft.Data.SQLite',
+ isConfigured: true,
+ requiresServer: false,
+ serverPlaceholder: null,
+ requiresCredentials: false,
+ supportsIntegratedAuthentication: false,
+ requiresConnectionTest: false,
+ },
+ ],
+ })
+ );
+ }),
+ ],
+ },
+ },
+};
+
export const Step4Installing: Story = () => html``;
Step4Installing.storyName = 'Step 4: Installing';