From a0acccc088d75fd174b7a03a506d9db6b19ad7ce Mon Sep 17 00:00:00 2001 From: Sam Lord Date: Wed, 1 Mar 2023 18:05:48 +0000 Subject: [PATCH] Prevent errors in E2E tests where front-end is disabled and Ghost Admin accesses themes refs: https://github.com/TryGhost/Toolbox/issues/389 --- ghost/core/test/utils/e2e-utils.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ghost/core/test/utils/e2e-utils.js b/ghost/core/test/utils/e2e-utils.js index 9aaab997cd..dfc48a294f 100644 --- a/ghost/core/test/utils/e2e-utils.js +++ b/ghost/core/test/utils/e2e-utils.js @@ -82,11 +82,11 @@ const prepareContentFolder = (options) => { if (options.copyThemes) { // Copy all themes into the new test content folder. Default active theme is always casper. If you want to use a different theme, you have to set the active theme (e.g. stub) fs.copySync(path.join(__dirname, 'fixtures', 'themes'), path.join(contentFolderForTests, 'themes')); - } else if (options.frontend) { - // Just copy Casper - fs.copySync(path.join(__dirname, 'fixtures', 'themes', 'casper'), path.join(contentFolderForTests, 'themes', 'casper')); } + // Copy theme even if frontend is disabled, as admin can use casper when viewing themes section + fs.copySync(path.join(__dirname, 'fixtures', 'themes', 'casper'), path.join(contentFolderForTests, 'themes', 'casper')); + if (options.redirectsFile) { redirects.setupFile(contentFolderForTests, options.redirectsFileExt); }