Skip to content

Commit

Permalink
Persist current slice during group modal navigation (#4836)
Browse files Browse the repository at this point in the history
* fix fallback slice

* group slice assertion when navigating samples

* fix test
  • Loading branch information
benjaminpkane authored Sep 25, 2024
1 parent 3828d2e commit 666f630
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/packages/state/src/hooks/useSetExpandedSample.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
},
[]
);
Expand Down
7 changes: 7 additions & 0 deletions e2e-pw/src/oss/specs/smoke-tests/quickstart-groups.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 }) => {
Expand Down

0 comments on commit 666f630

Please sign in to comment.