Skip to content

A fast 2D and 3D game engine — TypeScript SDK, C++/WebAssembly core, visual editor. Ship one project to web, desktop, WeChat MiniGames, playable ads, and native Android / iOS.

test(editor): a check says which editor mode it measures in

esengine987b7e0adc94
diff --git a/desktop/scripts/editor-checks/design-frame.mjs b/desktop/scripts/editor-checks/design-frame.mjs
index 78a6ec0b2..ba02a060d 100644
--- a/desktop/scripts/editor-checks/design-frame.mjs
+++ b/desktop/scripts/editor-checks/design-frame.mjs
@@ -127,5 +127,8 @@ export async function run(ed) {
+ 'trapezoid, and this is still being drawn as a box',
);
+ // The mode is remembered across sessions, so it outlives this editor and would
+ // decide what the next check's viewport draws.
+ await ed.call('run_editor_command', { id: 'mode.scene' }, 30000);
return check.failures;
}
diff --git a/desktop/scripts/editor-checks/gizmo-depth.mjs b/desktop/scripts/editor-checks/gizmo-depth.mjs
index 43bb9ba2b..cb106d919 100644
--- a/desktop/scripts/editor-checks/gizmo-depth.mjs
+++ b/desktop/scripts/editor-checks/gizmo-depth.mjs
@@ -91,6 +91,8 @@ export async function run(ed) {
const check = checker();
await ed.open(root, 'assets/scenes/main.esscene');
+ // The mode is remembered across sessions: say which one this is measured in.
+ await ed.call('run_editor_command', { id: 'mode.scene' }, 30000);
await ed.call('run_editor_command', { id: 'tool.move' }, 30000);
await ed.call('run_editor_command', { id: 'view.resetOrbit' }, 30000);
await ed.call('select', { id: null }, 30000);
diff --git a/desktop/scripts/editor-checks/selection-outline.mjs b/desktop/scripts/editor-checks/selection-outline.mjs
index d2cc93c4b..4d56e379f 100644
--- a/desktop/scripts/editor-checks/selection-outline.mjs
+++ b/desktop/scripts/editor-checks/selection-outline.mjs
@@ -98,6 +98,8 @@ export async function run(ed) {
const check = checker();
await ed.open(root, 'assets/scenes/main.esscene');
+ // The mode is remembered across sessions: say which one this is measured in.
+ await ed.call('run_editor_command', { id: 'mode.scene' }, 30000);
// The select tool draws no transform gizmo, so the only ink selecting adds around
// the entity is the outline itself (and the pivot dot, at the centre).
await ed.call('run_editor_command', { id: 'tool.select' }, 30000);