fix: app cypress e2e tests failing on core major version change

This commit is contained in:
Rainer Killinger
2025-07-01 11:42:24 +02:00
parent c8e290200f
commit a5c5c31d09
2 changed files with 9 additions and 3 deletions

View File

@@ -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');
}
/**