Update test to ensure transform controls are coherent across modes
This commit is contained in:
@@ -395,7 +395,7 @@ describe("transform foundation integration", () => {
|
||||
});
|
||||
});
|
||||
|
||||
it("keeps whole-box transforms in Object mode and disables them in component modes", async () => {
|
||||
it("keeps transform controls coherent across object and component modes", async () => {
|
||||
const { store, brush } = await renderTransformFixtureApp();
|
||||
|
||||
await act(async () => {
|
||||
@@ -409,7 +409,9 @@ describe("transform foundation integration", () => {
|
||||
});
|
||||
|
||||
expect(store.getState().whiteboxSelectionMode).toBe("face");
|
||||
expect(screen.getByTestId("transform-translate-button")).toBeDisabled();
|
||||
expect(screen.getByTestId("transform-translate-button")).not.toBeDisabled();
|
||||
expect(screen.getByTestId("transform-rotate-button")).not.toBeDisabled();
|
||||
expect(screen.getByTestId("transform-scale-button")).not.toBeDisabled();
|
||||
|
||||
act(() => {
|
||||
store.setSelection({
|
||||
@@ -419,7 +421,23 @@ describe("transform foundation integration", () => {
|
||||
});
|
||||
});
|
||||
|
||||
expect(screen.getByTestId("transform-translate-button")).toBeDisabled();
|
||||
expect(screen.getByTestId("transform-translate-button")).not.toBeDisabled();
|
||||
|
||||
await act(async () => {
|
||||
fireEvent.click(screen.getByTestId("whitebox-selection-mode-vertex"));
|
||||
});
|
||||
|
||||
act(() => {
|
||||
store.setSelection({
|
||||
kind: "brushVertex",
|
||||
brushId: brush.id,
|
||||
vertexId: "posX_posY_posZ"
|
||||
});
|
||||
});
|
||||
|
||||
expect(screen.getByTestId("transform-translate-button")).not.toBeDisabled();
|
||||
expect(screen.getByTestId("transform-rotate-button")).toBeDisabled();
|
||||
expect(screen.getByTestId("transform-scale-button")).toBeDisabled();
|
||||
|
||||
await act(async () => {
|
||||
fireEvent.click(screen.getByTestId("whitebox-selection-mode-object"));
|
||||
|
||||
Reference in New Issue
Block a user