Skip to content

Commit af43e35

Browse files
committed
fix
1 parent 31f5c8f commit af43e35

File tree

3 files changed

+5
-16
lines changed

3 files changed

+5
-16
lines changed

cypress/support/component.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,6 @@
1313
// https://on.cypress.io/configuration
1414
// ***********************************************************
1515

16-
// Set environment variable for Cypress tests
17-
if (window.Cypress) {
18-
(window as any).VITE_CYPRESS_TEST = 'true';
19-
}
20-
2116
import '@ui5/webcomponents-react/dist/Assets.js';
2217
import { ThemeProvider } from '@ui5/webcomponents-react';
2318

@@ -29,6 +24,11 @@ import './commands';
2924
import { FrontendConfigContext } from '../../src/context/FrontendConfigContext';
3025
import { mockedFrontendConfig } from '../../src/utils/testing';
3126
import { ToastProvider } from '../../src/context/ToastContext.tsx';
27+
import { configureMonaco } from '../../src/lib/monaco';
28+
29+
// Initialize Monaco Editor for Cypress tests
30+
configureMonaco();
31+
3232
// Augment the Cypress namespace to include type definitions for
3333
// your custom command.
3434
// Alternatively, can be defined in cypress/support/component.d.ts

src/components/YamlEditor/YamlEditor.tsx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,6 @@ export const YamlEditor = (props: YamlEditorProps) => {
4141
const [applyAttempted, setApplyAttempted] = useState(false);
4242

4343
useEffect(() => {
44-
// This check is to prevent schema configuration load during Cypress tests but Monaco still is being loaded
45-
if (window.VITE_CYPRESS_TEST) return;
46-
4744
const { dispose } = configureMonacoYaml(monaco, {
4845
isKubernetes: true,
4946
enableSchemaRequest: true,

src/vite-env.d.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1 @@
11
/// <reference types="vite/client" />
2-
3-
declare global {
4-
interface Window {
5-
VITE_CYPRESS_TEST?: string;
6-
}
7-
}
8-
9-
export {};

0 commit comments

Comments
 (0)