From 666f63077be9e5424888aa9d0a7db66f02e5dbc7 Mon Sep 17 00:00:00 2001 From: Benjamin Kane Date: Wed, 25 Sep 2024 13:49:13 -0400 Subject: [PATCH] Persist current slice during group modal navigation (#4836) * fix fallback slice * group slice assertion when navigating samples * fix test --- app/packages/state/src/hooks/useSetExpandedSample.ts | 4 ++-- e2e-pw/src/oss/specs/smoke-tests/quickstart-groups.spec.ts | 7 +++++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/app/packages/state/src/hooks/useSetExpandedSample.ts b/app/packages/state/src/hooks/useSetExpandedSample.ts index d5f7f270be..13ac9475e8 100644 --- a/app/packages/state/src/hooks/useSetExpandedSample.ts +++ b/app/packages/state/src/hooks/useSetExpandedSample.ts @@ -27,9 +27,9 @@ export default () => { .filter(({ mediaType }) => !THREE_D.has(mediaType)) .map(({ name }) => name) .sort()[0]; - } - set(groupAtoms.modalGroupSlice, fallback); + set(groupAtoms.modalGroupSlice, fallback); + } }, [] ); diff --git a/e2e-pw/src/oss/specs/smoke-tests/quickstart-groups.spec.ts b/e2e-pw/src/oss/specs/smoke-tests/quickstart-groups.spec.ts index a4178cd2ef..9a52106600 100644 --- a/e2e-pw/src/oss/specs/smoke-tests/quickstart-groups.spec.ts +++ b/e2e-pw/src/oss/specs/smoke-tests/quickstart-groups.spec.ts @@ -92,6 +92,13 @@ test.describe("quickstart-groups", () => { expect(await modal.sidebar.getSampleFilepath(false)).toEqual( FIRST_SAMPLE_FILENAME ); + + await modal.sidebar.toggleSidebarGroup("GROUP"); + await modal.navigateSlice("group.name", "right"); + await modal.navigateNextSample(); + expect(await modal.sidebar.getSidebarEntryText("group.name")).toEqual( + "right" + ); }); test("group media visibility toggle works", async ({ modal }) => {