mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2025-12-10 08:16:22 +00:00
fix: app cypress e2e tests failing on core major version change
This commit is contained in:
@@ -16,7 +16,8 @@
|
||||
/* eslint-disable @typescript-eslint/no-explicit-any */
|
||||
import equal from 'fast-deep-equal';
|
||||
import {extendsDeepEqual} from '@openstapps/collection-utils';
|
||||
import {SCSearchRequest, SCSearchResponse} from '@openstapps/core';
|
||||
import {CORE_VERSION, SCIndexResponse, SCSearchRequest, SCSearchResponse} from '@openstapps/core';
|
||||
import * as defaultConfig from '../../fixtures/config/default-config.json';
|
||||
|
||||
type InterceptArguments = {
|
||||
fixture?: string | SCSearchResponse | ((request: SCSearchRequest) => SCSearchResponse);
|
||||
@@ -34,7 +35,12 @@ type InterceptArguments = {
|
||||
*
|
||||
*/
|
||||
export function interceptConfig(config?: string) {
|
||||
cy.intercept({url: '/', method: 'POST'}, {fixture: config || 'config/default-config.json'}).as('config');
|
||||
let localConfig: SCIndexResponse = defaultConfig as unknown as SCIndexResponse;
|
||||
localConfig.backend.SCVersion = CORE_VERSION;
|
||||
cy.intercept(
|
||||
{url: '/', method: 'POST'},
|
||||
config ? {fixture: config} : {body: JSON.stringify(localConfig)},
|
||||
).as('config');
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -32,12 +32,12 @@
|
||||
"devDependencies": {
|
||||
"@changesets/changelog-git": "0.1.14",
|
||||
"@changesets/cli": "2.26.1",
|
||||
"merge-cobertura": "1.0.1",
|
||||
"deepmerge": "4.3.1",
|
||||
"dotenv-cli": "7.2.1",
|
||||
"glob": "10.3.10",
|
||||
"http-server": "14.1.1",
|
||||
"junit-report-merger": "6.0.3",
|
||||
"merge-cobertura": "1.0.1",
|
||||
"prettier": "3.1.1",
|
||||
"syncpack": "12.3.0",
|
||||
"turbo": "1.13.4",
|
||||
|
||||
Reference in New Issue
Block a user