Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Try to exclude decorator when running Cypress to see if less flaky #1025

Merged
merged 1 commit into from
Feb 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/fyllut-backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"scripts": {
"start": "cross-env-shell NODE_ENV=development vite",
"build": "tsc && vite build",
"preview": "cross-env-shell NODE_ENV=development NO_FORM_VALIDATION=true FYLLUT_BUILD_DIR=\"../../fyllut/dist\" PORT=3001 \"node bin/copyDotEnvTestToDist.js && cd dist && node server.mjs\"",
"preview": "cross-env-shell NODE_ENV=development NO_DECORATOR=true NO_FORM_VALIDATION=true FYLLUT_BUILD_DIR=\"../../fyllut/dist\" PORT=3001 \"node bin/copyDotEnvTestToDist.js && cd dist && node server.mjs\"",
"check-types": "tsc",
"clean": "rimraf dist coverage node_modules",
"test": "vitest --run",
Expand Down
2 changes: 1 addition & 1 deletion packages/fyllut-backend/src/config/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ const localDevelopmentConfig: DefaultConfig = {
mockIdportenPid: process.env.MOCK_IDPORTEN_PID || '12345678911',
mockIdportenJwt: process.env.MOCK_IDPORTEN_JWT || 'IDPORTEN_JWT',
noFormValidation: process.env.NO_FORM_VALIDATION === 'true',
noDecorator: process.env.NO_DECORATOR === 'false',
noDecorator: process.env.NO_DECORATOR === 'true',
tokenx: {
...tokenx,
wellKnownUrl:
Expand Down
4 changes: 0 additions & 4 deletions packages/fyllut-backend/src/renderIndex.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ const renderIndex = async (req: Request, res: Response, next: NextFunction) => {
const qpForm = req.query.form;
const qpInnsendingsId = req.query.innsendingsId;
const qpSub = req.query.sub as QueryParamSub;
const qbDisableDecorator = req.query.disableDecorator;
let redirectUrl: string | undefined;
let redirectParams: { [key: string]: any } = { ...req.query };
if (qpForm) {
Expand Down Expand Up @@ -98,9 +97,6 @@ const renderIndex = async (req: Request, res: Response, next: NextFunction) => {
httpStatusCode = 404;
}
}
if (!config.isProduction && qbDisableDecorator === 'true') {
return res.render('index.html', pageMeta);
}

const decoratorFragments = await getDecorator(createRedirectUrl(req, res));
res.status(httpStatusCode).render('index.html', {
Expand Down