Compare commits

..

1 Commits

Author SHA1 Message Date
dependabot[bot]
bb4139ffdb Bump the prod-patch-updates group across 1 directory with 4 updates
Bumps the prod-patch-updates group with 4 updates in the /frontend directory: [@tanstack/react-query](https://github.com/TanStack/query/tree/HEAD/packages/react-query), [formik](https://github.com/jaredpalmer/formik), [react](https://github.com/facebook/react/tree/HEAD/packages/react) and [react-dom](https://github.com/facebook/react/tree/HEAD/packages/react-dom).


Updates `@tanstack/react-query` from 5.90.6 to 5.90.20
- [Release notes](https://github.com/TanStack/query/releases)
- [Changelog](https://github.com/TanStack/query/blob/main/packages/react-query/CHANGELOG.md)
- [Commits](https://github.com/TanStack/query/commits/@tanstack/react-query@5.90.20/packages/react-query)

Updates `formik` from 2.4.6 to 2.4.9
- [Release notes](https://github.com/jaredpalmer/formik/releases)
- [Commits](https://github.com/jaredpalmer/formik/compare/formik@2.4.6...formik@2.4.9)

Updates `react` from 19.2.3 to 19.2.4
- [Release notes](https://github.com/facebook/react/releases)
- [Changelog](https://github.com/facebook/react/blob/main/CHANGELOG.md)
- [Commits](https://github.com/facebook/react/commits/v19.2.4/packages/react)

Updates `react-dom` from 19.2.3 to 19.2.4
- [Release notes](https://github.com/facebook/react/releases)
- [Changelog](https://github.com/facebook/react/blob/main/CHANGELOG.md)
- [Commits](https://github.com/facebook/react/commits/v19.2.4/packages/react-dom)

---
updated-dependencies:
- dependency-name: "@tanstack/react-query"
  dependency-version: 5.90.20
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: prod-patch-updates
- dependency-name: formik
  dependency-version: 2.4.9
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: prod-patch-updates
- dependency-name: react
  dependency-version: 19.2.4
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: prod-patch-updates
- dependency-name: react-dom
  dependency-version: 19.2.4
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: prod-patch-updates
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-01-26 22:50:35 +00:00
12 changed files with 70 additions and 113 deletions

View File

@@ -109,7 +109,7 @@ services:
- "cypress_logs:/test/results"
- "./dev/resolv.conf:/etc/resolv.conf:ro"
- "/etc/localtime:/etc/localtime:ro"
command: cypress run --browser chrome --config-file=cypress/config/ci.mjs
command: cypress run --browser chrome --config-file=cypress/config/ci.js
networks:
- fulltest

View File

@@ -192,7 +192,7 @@ services:
- "../test/results:/results"
- "./dev/resolv.conf:/etc/resolv.conf:ro"
- "/etc/localtime:/etc/localtime:ro"
command: cypress run --browser chrome --config-file=cypress/config/ci.mjs
command: cypress run --browser chrome --config-file=cypress/config/ci.js
networks:
- nginx_proxy_manager

View File

@@ -1,4 +1,4 @@
FROM cypress/included:15.9.0
FROM cypress/included:14.0.1
# Disable Cypress CLI colors
ENV FORCE_COLOR=0

View File

@@ -24,10 +24,10 @@ describe('Streams', () => {
// Create a custom cert pair
cy.exec('mkcert -cert-file=/test/cypress/fixtures/website1.pem -key-file=/test/cypress/fixtures/website1.key.pem website1.example.com').then((result) => {
expect(result.exitCode).to.eq(0);
expect(result.code).to.eq(0);
// Install CA
cy.exec('mkcert -install').then((result) => {
expect(result.exitCode).to.eq(0);
expect(result.code).to.eq(0);
});
});
@@ -56,7 +56,7 @@ describe('Streams', () => {
expect(data).to.have.property('udp_forwarding', false);
cy.exec('curl --noproxy -- http://website1.example.com:1500').then((result) => {
expect(result.exitCode).to.eq(0);
expect(result.code).to.eq(0);
expect(result.stdout).to.contain('yay it works');
});
});
@@ -107,7 +107,7 @@ describe('Streams', () => {
expect(data).to.have.property('udp_forwarding', true);
cy.exec('curl --noproxy -- http://website1.example.com:1502').then((result) => {
expect(result.exitCode).to.eq(0);
expect(result.code).to.eq(0);
expect(result.stdout).to.contain('yay it works');
});
});
@@ -176,7 +176,6 @@ describe('Streams', () => {
'cert_chain_of_trust',
'cert_extlifeSpan',
'cert_revocation',
'engine_problem',
'overall_grade',
];

View File

@@ -1,5 +1,5 @@
import axios from "axios";
import logger from "./logger.mjs";
const logger = require('./logger');
const axios = require('axios').default;
const BackendApi = function(config, token) {
this.config = config;
@@ -22,16 +22,18 @@ BackendApi.prototype.setToken = function (token) {
* @param {bool} returnOnError
*/
BackendApi.prototype._prepareOptions = function(returnOnError) {
const options = {
let options = {
headers: {
Accept: "application/json",
},
};
Accept: 'application/json'
}
}
if (this.token) {
options.headers.Authorization = `Bearer ${this.token}`;
options.headers.Authorization = 'Bearer ' + this.token;
}
if (returnOnError) {
options.validateStatus = () => true;
options.validateStatus = function () {
return true;
}
}
return options;
};
@@ -42,30 +44,13 @@ BackendApi.prototype._prepareOptions = function (returnOnError) {
* @param {function} reject
* @param {bool} returnOnError
*/
BackendApi.prototype._handleResponse = (
response,
resolve,
reject,
returnOnError,
) => {
logger("Response data:", response.data);
if (
!returnOnError &&
typeof response.data === "object" &&
typeof response.data.error === "object"
) {
if (
typeof response.data === "object" &&
typeof response.data.error === "object" &&
typeof response.data.error.message !== "undefined"
) {
reject(
new Error(
`${response.data.error.code}: ${response.data.error.message}`,
),
);
BackendApi.prototype._handleResponse = function(response, resolve, reject, returnOnError) {
logger('Response data:', response.data);
if (!returnOnError && typeof response.data === 'object' && typeof response.data.error === 'object') {
if (typeof response.data === 'object' && typeof response.data.error === 'object' && typeof response.data.error.message !== 'undefined') {
reject(new Error(response.data.error.code + ': ' + response.data.error.message));
} else {
reject(new Error(`Error ${response.status}`));
reject(new Error('Error ' + response.status));
}
} else {
resolve(response.data);
@@ -78,10 +63,10 @@ BackendApi.prototype._handleResponse = (
* @param {function} reject
* @param {bool} returnOnError
*/
BackendApi.prototype._handleError = (err, resolve, reject, returnOnError) => {
logger("Axios Error:", err);
BackendApi.prototype._handleError = function(err, resolve, reject, returnOnError) {
logger('Axios Error:', err);
if (returnOnError) {
resolve(typeof err.response.data !== "undefined" ? err.response.data : err);
resolve(typeof err.response.data !== 'undefined' ? err.response.data : err);
} else {
reject(err);
}
@@ -99,11 +84,11 @@ BackendApi.prototype.request = function (method, path, returnOnError, data) {
const options = this._prepareOptions(returnOnError);
return new Promise((resolve, reject) => {
const opts = {
let opts = {
method: method,
url: path,
...options,
};
...options
}
if (data !== undefined && data !== null) {
opts.data = data;
}
@@ -125,17 +110,16 @@ BackendApi.prototype.request = function (method, path, returnOnError, data) {
* @returns {Promise<object>}
*/
BackendApi.prototype.postForm = function (path, form, returnOnError) {
logger("POST", this.config.baseUrl + path);
logger('POST', this.config.baseUrl + path);
const options = this._prepareOptions(returnOnError);
return new Promise((resolve, reject) => {
const opts = {
...options,
...form.getHeaders(),
};
}
this.axios
.post(path, form, opts)
this.axios.post(path, form, opts)
.then((response) => {
this._handleResponse(response, resolve, reject, returnOnError);
})
@@ -145,4 +129,4 @@ BackendApi.prototype.postForm = function (path, form, returnOnError) {
});
};
export default BackendApi;
module.exports = BackendApi;

View File

@@ -0,0 +1,7 @@
const _ = require("lodash");
module.exports = function() {
let arr = _.values(arguments);
arr.unshift('[Backend API]');
console.log.apply(null, arr);
};

View File

@@ -1,7 +0,0 @@
const log = (...args) => {
const arr = args;
arr.unshift("[Backend API]");
console.log(...arr);
};
export default log;

View File

@@ -1,12 +1,13 @@
import fs from "node:fs";
import FormData from "form-data";
import Client from "./client.mjs";
import logger from "./logger.mjs";
const fs = require('fs');
const FormData = require('form-data');
const logger = require('./logger');
const Client = require('./client');
export default (config) => {
logger("Client Ready using", config.baseUrl);
module.exports = function (config) {
logger('Client Ready using', config.baseUrl);
return {
/**
* @param {object} options
* @param {string} options.path API path
@@ -17,7 +18,7 @@ export default (config) => {
backendApiGet: (options) => {
const api = new Client(config);
api.setToken(options.token);
return api.request("get", options.path, options.returnOnError || false);
return api.request('get', options.path, options.returnOnError || false);
},
/**
@@ -31,12 +32,7 @@ export default (config) => {
backendApiPost: (options) => {
const api = new Client(config);
api.setToken(options.token);
return api.request(
"post",
options.path,
options.returnOnError || false,
options.data,
);
return api.request('post', options.path, options.returnOnError || false, options.data);
},
/**
@@ -52,11 +48,8 @@ export default (config) => {
api.setToken(options.token);
const form = new FormData();
for (const [key, value] of Object.entries(options.files)) {
form.append(
key,
fs.createReadStream(`${config.fixturesFolder}/${value}`),
);
for (let [key, value] of Object.entries(options.files)) {
form.append(key, fs.createReadStream(config.fixturesFolder + '/' + value));
}
return api.postForm(options.path, form, options.returnOnError || false);
},
@@ -72,12 +65,7 @@ export default (config) => {
backendApiPut: (options) => {
const api = new Client(config);
api.setToken(options.token);
return api.request(
"put",
options.path,
options.returnOnError || false,
options.data,
);
return api.request('put', options.path, options.returnOnError || false, options.data);
},
/**
@@ -90,11 +78,7 @@ export default (config) => {
backendApiDelete: (options) => {
const api = new Client(config);
api.setToken(options.token);
return api.request(
"delete",
options.path,
options.returnOnError || false,
);
},
return api.request('delete', options.path, options.returnOnError || false);
}
};
};

View File

@@ -1,26 +1,20 @@
import { SwaggerValidation } from "@jc21/cypress-swagger-validation";
import chalk from "chalk";
import backendTask from "./backendApi/task.mjs";
import { SwaggerValidation } from '@jc21/cypress-swagger-validation';
import chalk from 'chalk';
export default (on, config) => {
// Replace swaggerBase config var wildcard
if (typeof config.env.swaggerBase !== "undefined") {
config.env.swaggerBase = config.env.swaggerBase.replace(
"{{baseUrl}}",
config.baseUrl,
);
if (typeof config.env.swaggerBase !== 'undefined') {
config.env.swaggerBase = config.env.swaggerBase.replace('{{baseUrl}}', config.baseUrl);
}
// Plugin Events
on("task", SwaggerValidation(config));
on("task", backendTask(config));
on("task", {
on('task', SwaggerValidation(config));
on('task', require('./backendApi/task')(config));
on('task', {
log(message) {
console.log(
`${chalk.cyan.bold("[")}${chalk.blue.bold("LOG")}${chalk.cyan.bold("]")} ${chalk.red.bold(message)}`,
);
console.log(`${chalk.cyan.bold('[')}${chalk.blue.bold('LOG')}${chalk.cyan.bold(']')} ${chalk.red.bold(message)}`);
return null;
},
}
});
return config;

View File

@@ -35,7 +35,7 @@ Cypress.Commands.add("validateSwaggerFile", (url, savePath) => {
.then((response) => cy.writeFile(savePath, response.body, { log: false }))
.then(() => cy.exec(`yarn swagger-lint '${savePath}'`, { failOnNonZeroExit: false }))
.then((result) => cy.task('log', `Swagger Vacuum Results:\n${result.stdout || ''}`)
.then(() => expect(result.exitCode).to.eq(0)));
.then(() => expect(result.code).to.eq(0)));
});
});

View File

@@ -1,4 +1,4 @@
import './commands.mjs';
import './commands';
Cypress.on('uncaught:exception', (/*err, runnable*/) => {
// returning false here prevents Cypress from

View File

@@ -4,10 +4,6 @@
"cypress/**/*.js",
"cypress/config/dev.mjs",
"cypress/config/ci.mjs",
"cypress/plugins/index.mjs",
"cypress/plugins/backendApi/task.mjs",
"cypress/plugins/backendApi/logger.mjs",
"cypress/plugins/backendApi/client.mjs",
"cypress/support/commands.mjs"
"cypress/plugins/index.mjs"
]
}