Skip to content

Commit

Permalink
chore: updated dev dependencies and raised node version
Browse files Browse the repository at this point in the history
  • Loading branch information
web-mi committed Jan 24, 2024
1 parent 2302b1f commit 1345f20
Show file tree
Hide file tree
Showing 22 changed files with 21,790 additions and 13,262 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
- uses: actions/[email protected]
- uses: actions/setup-node@v3
with:
node-version: 14
node-version: 18
registry-url: 'https://npm.pkg.github.com'
cache: 'npm'
- name: Load .env file
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/dockerImage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
fi
- uses: actions/setup-node@v3
with:
node-version: 14
node-version: 18
cache: 'npm'
- name: Load .env file
uses: xom9ikk/dotenv@v2
Expand Down
6 changes: 1 addition & 5 deletions .stylelintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,9 @@ const defaultConfig = require('@biotope/quality-gate/config/.stylelintrc');
module.exports = {
...defaultConfig,
extends: [
// TODO: From the admin app. Probably a good idea to enable.
// 'stylelint-config-idiomatic-order',

// The config from quality-gate isn't compatible with stylelint@^14,
// therefore merge it with working alternatives.
'stylelint-config-standard-scss',
'stylelint-config-prettier'
'stylelint-config-standard-scss'
],
rules: {
...defaultConfig.rules,
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG NODE_VERSION=14.21.1
ARG NODE_VERSION=18.16.1
ARG PORT=80

FROM node:$NODE_VERSION as proxyBuild
Expand Down Expand Up @@ -41,6 +41,6 @@ COPY build /app/build
ENV NODE_ENV=production
ENV PORT=$PORT

RUN npm install --ignore-scripts
RUN npm ci --ignore-scripts

CMD ["npm", "run", "start"]
5 changes: 4 additions & 1 deletion config/env.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,10 @@ function getClientEnvironment(publicUrl) {
// and `sockPort` options in webpack-dev-server.
WDS_SOCKET_HOST: process.env.WDS_SOCKET_HOST,
WDS_SOCKET_PATH: process.env.WDS_SOCKET_PATH,
WDS_SOCKET_PORT: process.env.WDS_SOCKET_PORT
WDS_SOCKET_PORT: process.env.WDS_SOCKET_PORT,
// Whether or not react-refresh is enabled.
// It is defined here so it is available in the webpackHotDevClient.
FAST_REFRESH: process.env.FAST_REFRESH !== 'false'
}
);
// Stringify all values so we can feed into webpack DefinePlugin
Expand Down
29 changes: 0 additions & 29 deletions config/jest/babelTransform.js

This file was deleted.

14 changes: 0 additions & 14 deletions config/jest/cssTransform.js

This file was deleted.

40 changes: 0 additions & 40 deletions config/jest/fileTransform.js

This file was deleted.

2 changes: 1 addition & 1 deletion config/paths.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ module.exports = {
appJsConfig: resolveApp('jsconfig.json'),
yarnLockFile: resolveApp('yarn.lock'),
testsSetup: resolveModule(resolveApp, 'src/setupTests'),
proxySetup: resolveApp('src/setupProxy.js'),
proxySetup: resolveApp('proxy/routes/index.js'),
appNodeModules: resolveApp('node_modules'),
appWebpackCache: resolveApp('node_modules/.cache'),
appTsBuildInfoFile: resolveApp('node_modules/.cache/tsconfig.tsbuildinfo'),
Expand Down
12 changes: 6 additions & 6 deletions cypress/e2e/tokens.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ describe('Keycloak Tokens', () => {
});
});

it.skip('should keep refreshing access token before it expires', () => {
it('should keep refreshing access token before it expires', () => {
cy.clock();
cy.login();
cy.wait('@askerSessions');
Expand All @@ -67,7 +67,7 @@ describe('Keycloak Tokens', () => {
}
});

it.skip('should refresh the access token if its expired when loading the app', () => {
it('should refresh the access token if its expired when loading the app', () => {
cy.willReturn('consultingType', { statusCode: 404 });

cy.clock();
Expand All @@ -93,10 +93,10 @@ describe('Keycloak Tokens', () => {
});

it.skip('should logout if refresh token is already expired when loading the app', () => {
cy.clock();
cy.login();
cy.wait('@askerSessions');
cy.wait('@usersData');
cy.clock();

cy.clock().then((clock) => {
clock.restore();
Expand All @@ -112,10 +112,10 @@ describe('Keycloak Tokens', () => {

//TODO: inspect this test, as there seems to be a race condition
it.skip('should logout if refresh token is expired while the app is loaded', () => {
cy.clock();
cy.login();
cy.wait('@askerSessions');
cy.wait('@usersData');
cy.clock();

waitForTokenProcessing();

Expand All @@ -126,7 +126,7 @@ describe('Keycloak Tokens', () => {
cy.get('.loginForm').should('exist');
});

it.skip('should not logout if refresh token is expired but access token is still valid', () => {
it('should not logout if refresh token is expired but access token is still valid', () => {
cy.clock();
cy.login({
auth: { expires_in: 1800, refresh_expires_in: 600 }
Expand All @@ -142,7 +142,7 @@ describe('Keycloak Tokens', () => {
cy.get('.loginForm').should('not.exist');
});

it.skip('should not logout if refresh token is expired but access token is still valid when the app loads', () => {
it('should not logout if refresh token is expired but access token is still valid when the app loads', () => {
const refreshExpiresIn = 600;

cy.clock();
Expand Down
28 changes: 19 additions & 9 deletions cypress/support/commands/mockApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ import {
let overrides = {};

const defaultReturns = {
attachmentUpload: {
'attachmentUpload': {
statusCode: 201
},
userData: {
'userData': {
emailToggles: [
{
name: 'DAILY_ENQUIRY',
Expand All @@ -49,22 +49,23 @@ const defaultReturns = {
}
]
},
consultingTypes: [],
settings: {},
releases: {
'consultingTypes': [],
'settings': {},
'releases': {
statusCode: 404
},
releases_markup: {
'releases_markup': {
statusCode: 404
},
sessionRooms: {
'sessionRooms': {
statusCode: 200,
body: {
sessions: []
}
},
agencyConsultants: [],
agencyConsultantsLanguages: ['de']
'frontend.settings': {},
'agencyConsultants': [],
'agencyConsultantsLanguages': ['de']
};

Cypress.Commands.add('willReturn', (name: string, data: any) => {
Expand Down Expand Up @@ -224,6 +225,15 @@ Cypress.Commands.add('mockApi', () => {
})
);

cy.intercept('GET', endpoints.frontend.settings, (req) =>
req.reply(
JSON.stringify({
...defaultReturns['frontend.settings'],
...(overrides['frontend.settings'] || {})
})
)
);

cy.intercept(
'GET',
`${endpoints.rc.settings.public}*`,
Expand Down
Loading

0 comments on commit 1345f20

Please sign in to comment.