Add test for toggling axis keys from world to local while translating a selected edge
This commit is contained in:
@@ -785,6 +785,69 @@ describe("transform foundation integration", () => {
|
|||||||
).toBeInTheDocument();
|
).toBeInTheDocument();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it("toggles repeated axis keys from world to local while translating a selected edge", 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: "2",
|
||||||
|
code: "Digit2"
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
act(() => {
|
||||||
|
store.setSelection({
|
||||||
|
kind: "brushEdge",
|
||||||
|
brushId: brush.id,
|
||||||
|
edgeId: "edgeX_posY_negZ"
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
fireEvent.keyDown(window, {
|
||||||
|
key: "g",
|
||||||
|
code: "KeyG"
|
||||||
|
});
|
||||||
|
fireEvent.keyDown(window, {
|
||||||
|
key: "z",
|
||||||
|
code: "KeyZ"
|
||||||
|
});
|
||||||
|
|
||||||
|
expect(
|
||||||
|
store.getState().viewportTransientState.transformSession
|
||||||
|
).toMatchObject({
|
||||||
|
kind: "active",
|
||||||
|
target: {
|
||||||
|
kind: "brushEdge",
|
||||||
|
brushId: brush.id,
|
||||||
|
edgeId: "edgeX_posY_negZ"
|
||||||
|
},
|
||||||
|
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("does not reapply the persisted viewport camera state across transform commit, cancel, and delete", async () => {
|
it("does not reapply the persisted viewport camera state across transform commit, cancel, and delete", async () => {
|
||||||
const { store, brush, viewportHost } = await renderTransformFixtureApp();
|
const { store, brush, viewportHost } = await renderTransformFixtureApp();
|
||||||
const persistedCameraState: ViewportPanelCameraState = {
|
const persistedCameraState: ViewportPanelCameraState = {
|
||||||
|
|||||||
Reference in New Issue
Block a user