Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
chrismaltby committed Mar 26, 2024
1 parent a948911 commit 0569e67
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 2 deletions.
20 changes: 18 additions & 2 deletions test/components/forms/VariableSelect.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,15 @@ test("Should use default custom event variable name with not renamed", () => {
} as unknown as Store<RootState, AnyAction>;

render(
<ScriptEditorContext.Provider value="script">
<ScriptEditorContext.Provider
value={{
type: "script",
entityType: "customEvent",
entityId: "customEvent1",
sceneId: "",
scriptKey: "script",
}}
>
<VariableSelect
name="test"
entityId="customEvent1"
Expand Down Expand Up @@ -174,7 +182,15 @@ test("Should use renamed variable for custom event", () => {
} as unknown as Store<RootState, AnyAction>;

render(
<ScriptEditorContext.Provider value="script">
<ScriptEditorContext.Provider
value={{
type: "script",
entityType: "customEvent",
entityId: "customEvent1",
sceneId: "",
scriptKey: "script",
}}
>
<VariableSelect
name="test"
entityId="customEvent1"
Expand Down
12 changes: 12 additions & 0 deletions test/dummydata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import { initialState as initialSpriteState } from "../src/store/features/sprite
import { initialState as initialScriptEventDefsState } from "../src/store/features/scriptEventDefs/scriptEventDefsState";
import { initialState as initialTrackerState } from "../src/store/features/tracker/trackerState";
import { initialState as initialTrackerDocumentState } from "../src/store/features/trackerDocument/trackerDocumentState";
import { initialState as initialDebuggerState } from "../src/store/features/debugger/debuggerState";
import compileFonts, {
PrecompiledFontData,
} from "../src/lib/compiler/compileFonts";
Expand Down Expand Up @@ -267,6 +268,14 @@ export const dummyProjectData: ProjectData = {
customControlsB: ["Control", "k", "x"],
customControlsStart: ["Enter"],
customControlsSelect: ["Shift"],
debuggerEnabled: false,
debuggerScriptType: "editor",
debuggerVariablesFilter: "all",
debuggerCollapsedPanes: [],
debuggerPauseOnScriptChanged: false,
debuggerPauseOnWatchedVariableChanged: false,
debuggerBreakpoints: [],
debuggerWatchedVariables: [],
},
};

Expand Down Expand Up @@ -326,6 +335,9 @@ export const dummyRootState: RootState = {
tracker: {
...initialTrackerState,
},
debug: {
...initialDebuggerState,
},
trackerDocument: {
past: [],
future: [],
Expand Down

0 comments on commit 0569e67

Please sign in to comment.