feat: removed usage of structuredClone inside the editorWarningSystem
ref: N25B-450
This commit is contained in:
@@ -1,5 +1,10 @@
|
||||
import '@testing-library/jest-dom';
|
||||
import { cleanup } from '@testing-library/react';
|
||||
import {
|
||||
type CompositeWarningKey,
|
||||
type SeverityIndex,
|
||||
type WarningRegistry
|
||||
} from "../src/pages/VisProgPage/visualProgrammingUI/components/EditorWarnings.tsx";
|
||||
import useFlowStore from '../src/pages/VisProgPage/visualProgrammingUI/VisProgStores.tsx';
|
||||
|
||||
if (!globalThis.structuredClone) {
|
||||
@@ -69,31 +74,33 @@ export const mockReactFlow = () => {
|
||||
|
||||
};
|
||||
|
||||
const emptySeverityIndex : SeverityIndex = new Map([
|
||||
['INFO', new Set<CompositeWarningKey>()],
|
||||
['WARNING', new Set<CompositeWarningKey>()],
|
||||
['ERROR', new Set<CompositeWarningKey>()],
|
||||
]);
|
||||
|
||||
const emptyWarningRegistry : WarningRegistry = new Map();
|
||||
|
||||
const defaultState = {
|
||||
nodes: [],
|
||||
edges: [],
|
||||
past: [],
|
||||
future: [],
|
||||
isBatchAction: false,
|
||||
edgeReconnectSuccessful: true,
|
||||
ruleRegistry: new Map(),
|
||||
editorWarningRegistry: emptyWarningRegistry,
|
||||
severityIndex: emptySeverityIndex,
|
||||
}
|
||||
|
||||
beforeAll(() => {
|
||||
useFlowStore.setState({
|
||||
nodes: [],
|
||||
edges: [],
|
||||
past: [],
|
||||
future: [],
|
||||
isBatchAction: false,
|
||||
edgeReconnectSuccessful: true,
|
||||
ruleRegistry: new Map()
|
||||
});
|
||||
useFlowStore.setState(defaultState);
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
cleanup();
|
||||
useFlowStore.setState({
|
||||
nodes: [],
|
||||
edges: [],
|
||||
past: [],
|
||||
future: [],
|
||||
isBatchAction: false,
|
||||
edgeReconnectSuccessful: true,
|
||||
ruleRegistry: new Map()
|
||||
});
|
||||
useFlowStore.setState(defaultState);
|
||||
});
|
||||
|
||||
if (typeof HTMLDialogElement !== 'undefined') {
|
||||
|
||||
Reference in New Issue
Block a user