* merge libs rollup configs to one rollup * move css from libs to src/core * run rollup on cms build * move test-utils to /utils folder * move css to src/core * mark @umbraco-cms/backoffice as external when building for CMS * rename all models to include @umbraco-cms/backoffice in their path to allow us to publish as a single module * rename all imports to @umbraco-cms/backoffice/* * rename events to umb-events to avoid rollup error of protected module name(?) * test that libs can build * move css to src/core * move umb-lit-element and modal elements to src/core * move some modal interfaces back to libs/modal * move the icon store into src/core since it is very localized to the backoffice * comment out build:libs for now since Github runs out of memory * rename to match tsconfig alias * add package.json to libs * only make libs for lib folders * turn off emit for typescript since we are handling types for libs separately * build libs locally * add script to move libs to final destination with some transform * move libs after build * move package.json to dist folder first (so we can publish from there) * remove inline comments * ensure the outputDir exists * Remove re-export of extensions-registry library from models library * move to individual files to avoid circular imports * check if outputDir exists before trying to create it * write transforms first in dist file and then copy the file to outputDir * ensure all umbraco types are external * copy information from main package.json file
92 lines
2.7 KiB
TypeScript
92 lines
2.7 KiB
TypeScript
import { rest } from 'msw';
|
|
|
|
import { umbracoPath } from '@umbraco-cms/backoffice/utils';
|
|
import { ProblemDetailsModel, RuntimeLevelModel, ServerStatusResponseModel } from '@umbraco-cms/backoffice/backend-api';
|
|
import { expect, test } from './test';
|
|
|
|
test.describe('installer tests', () => {
|
|
test.beforeEach(async ({ page, worker }) => {
|
|
await worker.use(
|
|
// Override the server status to be "must-install"
|
|
rest.get(umbracoPath('/server/status'), (_req, res, ctx) => {
|
|
return res(
|
|
// Respond with a 200 status code
|
|
ctx.status(200),
|
|
ctx.json<ServerStatusResponseModel>({
|
|
serverStatus: RuntimeLevelModel.INSTALL,
|
|
})
|
|
);
|
|
})
|
|
);
|
|
|
|
await page.goto('/install');
|
|
|
|
await page.waitForSelector('[data-test="installer"]');
|
|
});
|
|
|
|
test('installer is shown', async ({ page }) => {
|
|
await expect(page).toHaveURL('/install');
|
|
});
|
|
|
|
test.describe('test success and failure', () => {
|
|
test.beforeEach(async ({ page }) => {
|
|
await page.waitForSelector('[data-test="installer-user"]');
|
|
await page.fill('[aria-label="name"]', 'Test');
|
|
await page.fill('[aria-label="email"]', 'test@umbraco');
|
|
await page.fill('[aria-label="password"]', 'test123456');
|
|
await page.click('[name="subscribeToNewsletter"]');
|
|
|
|
// Go to the next step
|
|
await page.click('[aria-label="Next"]');
|
|
|
|
// Set telemetry
|
|
await page.waitForSelector('[data-test="installer-telemetry"]');
|
|
await page.waitForSelector('uui-slider[name="telemetryLevel"]');
|
|
|
|
// Click [aria-label="Next"]
|
|
await page.click('[aria-label="Next"]');
|
|
|
|
// Database form
|
|
await page.waitForSelector('[data-test="installer-database"]');
|
|
});
|
|
|
|
test('installer completes successfully', async ({ page }) => {
|
|
await page.click('[aria-label="Install"]');
|
|
await page.waitForSelector('umb-backoffice', { timeout: 30000 });
|
|
});
|
|
|
|
test('installer fails', async ({ page, worker }) => {
|
|
await worker.use(
|
|
// Override the server status to be "must-install"
|
|
rest.post(umbracoPath('/install/setup'), (_req, res, ctx) => {
|
|
return res(
|
|
// Respond with a 200 status code
|
|
ctx.status(400),
|
|
ctx.json<ProblemDetailsModel>({
|
|
status: 400,
|
|
type: 'validation',
|
|
detail: 'Something went wrong',
|
|
errors: {
|
|
databaseName: ['The database name is required'],
|
|
},
|
|
})
|
|
);
|
|
})
|
|
);
|
|
|
|
await page.click('[aria-label="Install"]');
|
|
|
|
await page.waitForSelector('[data-test="installer-error"]');
|
|
|
|
await expect(page.locator('[data-test="error-message"]')).toHaveText('Something went wrong', {
|
|
useInnerText: true,
|
|
});
|
|
|
|
// Click reset button
|
|
await page.click('#button-reset');
|
|
|
|
await page.waitForSelector('[data-test="installer-user"]');
|
|
});
|
|
});
|
|
});
|