Update tool mode in tests and CSS

This commit is contained in:
2026-04-03 00:23:52 +02:00
parent 697ad5cbca
commit 32a611a71f
3 changed files with 13 additions and 13 deletions

View File

@@ -870,7 +870,7 @@ button:disabled {
line-height: 1.35;
}
.viewport-canvas--box-create {
.viewport-canvas--create {
cursor: copy;
}

View File

@@ -19,7 +19,7 @@ describe("typed entity upsert command", () => {
maxDistance: 12
});
store.setToolMode("box-create");
store.setToolMode("create");
store.executeCommand(
createUpsertEntityCommand({
entity: soundEmitter,
@@ -35,7 +35,7 @@ describe("typed entity upsert command", () => {
expect(store.getState().document.entities[soundEmitter.id]).toEqual(soundEmitter);
expect(store.undo()).toBe(true);
expect(store.getState().toolMode).toBe("box-create");
expect(store.getState().toolMode).toBe("create");
expect(store.getState().document.entities).toEqual({});
expect(store.redo()).toBe(true);
@@ -56,7 +56,7 @@ describe("typed entity upsert command", () => {
distance: 9
});
store.setToolMode("box-create");
store.setToolMode("create");
store.executeCommand(
createUpsertEntityCommand({
entity: pointLight,
@@ -72,7 +72,7 @@ describe("typed entity upsert command", () => {
expect(store.getState().document.entities[pointLight.id]).toEqual(pointLight);
expect(store.undo()).toBe(true);
expect(store.getState().toolMode).toBe("box-create");
expect(store.getState().toolMode).toBe("create");
expect(store.getState().document.entities).toEqual({});
expect(store.redo()).toBe(true);
@@ -112,7 +112,7 @@ describe("typed entity upsert command", () => {
label: "Place trigger volume"
})
);
store.setToolMode("box-create");
store.setToolMode("create");
store.executeCommand(
createUpsertEntityCommand({
entity: movedTriggerVolume,
@@ -124,7 +124,7 @@ describe("typed entity upsert command", () => {
expect(store.getState().document.entities[triggerVolume.id]).toEqual(movedTriggerVolume);
expect(store.undo()).toBe(true);
expect(store.getState().toolMode).toBe("box-create");
expect(store.getState().toolMode).toBe("create");
expect(store.getState().document.entities[triggerVolume.id]).toEqual(triggerVolume);
expect(store.redo()).toBe(true);
@@ -165,7 +165,7 @@ describe("typed entity upsert command", () => {
label: "Place spot light"
})
);
store.setToolMode("box-create");
store.setToolMode("create");
store.executeCommand(
createUpsertEntityCommand({
entity: movedSpotLight,
@@ -177,7 +177,7 @@ describe("typed entity upsert command", () => {
expect(store.getState().document.entities[spotLight.id]).toEqual(movedSpotLight);
expect(store.undo()).toBe(true);
expect(store.getState().toolMode).toBe("box-create");
expect(store.getState().toolMode).toBe("create");
expect(store.getState().document.entities[spotLight.id]).toEqual(spotLight);
expect(store.redo()).toBe(true);

View File

@@ -7,7 +7,7 @@ describe("player start command", () => {
it("restores the previous tool mode across undo and redo when placing PlayerStart", () => {
const store = createEditorStore();
store.setToolMode("box-create");
store.setToolMode("create");
store.executeCommand(
createSetPlayerStartCommand({
position: {
@@ -25,7 +25,7 @@ describe("player start command", () => {
expect(store.getState().toolMode).toBe("select");
expect(store.undo()).toBe(true);
expect(store.getState().toolMode).toBe("box-create");
expect(store.getState().toolMode).toBe("create");
expect(store.getState().document.entities).toEqual({});
expect(store.redo()).toBe(true);
@@ -49,7 +49,7 @@ describe("player start command", () => {
const existingPlayerStart = Object.values(store.getState().document.entities)[0];
store.setToolMode("box-create");
store.setToolMode("create");
store.executeCommand(
createSetPlayerStartCommand({
entityId: existingPlayerStart.id,
@@ -73,7 +73,7 @@ describe("player start command", () => {
});
expect(store.undo()).toBe(true);
expect(store.getState().toolMode).toBe("box-create");
expect(store.getState().toolMode).toBe("create");
expect(store.getState().document.entities[existingPlayerStart.id]).toEqual(existingPlayerStart);
expect(store.redo()).toBe(true);