From 17774a565e6a5e4eaed6b570166e31b95dc91f75 Mon Sep 17 00:00:00 2001 From: Alex Taing Date: Wed, 25 Oct 2023 09:32:29 -0400 Subject: [PATCH] os specific shortcuts test --- .../studio-ui/tests/components/UndoRedo.test.tsx | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/packages/studio-ui/tests/components/UndoRedo.test.tsx b/packages/studio-ui/tests/components/UndoRedo.test.tsx index 9cd41ca5a..44fd2522b 100644 --- a/packages/studio-ui/tests/components/UndoRedo.test.tsx +++ b/packages/studio-ui/tests/components/UndoRedo.test.tsx @@ -56,22 +56,30 @@ describe("Undo/redo", () => { expect(useStudioStore.getState().pages.activeComponentUUID).toBeUndefined(); }); - it("undoes last state update using control + z if OS is not OS X", async () => { + it("only undoes last state update using control + z if not in OS X", async () => { platform.os.family = "Windows"; render(); expect(useStudioStore.getState().pages.activeComponentUUID).toBe( "searchbar-uuid" ); + await userEvent.keyboard("{Meta>}z{/Meta}"); + expect(useStudioStore.getState().pages.activeComponentUUID).toBe( + "searchbar-uuid" + ); await userEvent.keyboard("{Control>}z{/Control}"); expect(useStudioStore.getState().pages.activeComponentUUID).toBeUndefined(); }); - it("undoes last state update using command + z is OS is OS X", async () => { + it("only undoes last state update using command + z if in OS X", async () => { platform.os.family = "OS X"; render(); expect(useStudioStore.getState().pages.activeComponentUUID).toBe( "searchbar-uuid" ); + await userEvent.keyboard("{Control>}z{/Control}"); + expect(useStudioStore.getState().pages.activeComponentUUID).toBe( + "searchbar-uuid" + ); await userEvent.keyboard("{Meta>}z{/Meta}"); expect(useStudioStore.getState().pages.activeComponentUUID).toBeUndefined(); });