Add test case for toggling axis keys from world to local while translating a selected face

This commit is contained in:
2026-04-12 00:48:54 +02:00
parent 0e7d18fd35
commit 497db52164

View File

@@ -848,6 +848,69 @@ describe("transform foundation integration", () => {
).toBeInTheDocument();
});
it("toggles repeated axis keys from world to local while translating a selected face", async () => {
const { store, brush } = await renderTransformFixtureApp();
await act(async () => {
fireEvent.click(
screen.getByRole("button", { name: /^Brush Transform Fixture$/ })
);
});
await act(async () => {
fireEvent.keyDown(window, {
key: "1",
code: "Digit1"
});
});
act(() => {
store.setSelection({
kind: "brushFace",
brushId: brush.id,
faceId: "posY"
});
});
fireEvent.keyDown(window, {
key: "g",
code: "KeyG"
});
fireEvent.keyDown(window, {
key: "z",
code: "KeyZ"
});
expect(
store.getState().viewportTransientState.transformSession
).toMatchObject({
kind: "active",
target: {
kind: "brushFace",
brushId: brush.id,
faceId: "posY"
},
axisConstraint: "z",
axisConstraintSpace: "world"
});
fireEvent.keyDown(window, {
key: "z",
code: "KeyZ"
});
expect(
store.getState().viewportTransientState.transformSession
).toMatchObject({
kind: "active",
axisConstraint: "z",
axisConstraintSpace: "local"
});
expect(
screen.getByText(/constrained move to local z\./i)
).toBeInTheDocument();
});
it("toggles repeated axis keys from world to local while translating a selected vertex", async () => {
const { store, brush } = await renderTransformFixtureApp();