fix(web): snapshot preview no longer shows another snapshot's copied state #48098
Closedonly21mil(GitHub profile, opens in a new tab)wants to merge 3 commits into
main fromrefs/pull/48098/headopened View on GitHubtanstack-source added labelsbug
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:XS
- @@ -468,0 +485,21 @@485+ preview={{486+ images: [487+ { src: PIXEL, name: "shot1.png", source: snapShotSource, onCopySnapshot: copyFirst },488+ { src: PIXEL, name: "shot2.png", source: snapShotSource, onCopySnapshot: copySecond },489+ ],490+ index: 0,491+ }}492+ onClose={() => {}}493+ />,494+ // The dialog renders no links and reads no route.495+ { router: false },496+ );497+498+ const copyButton = () => screen.getByRole("button", { name: "Copy snapshot" });499+ await userEvent.click(copyButton());500+ await expect.element(copyButton()).toBeDisabled();501+502+ await userEvent.click(screen.getByRole("button", { name: "Next media" }));503+ await expect.element(screen.getByText("shot2.png (2/2)")).toBeVisible();504+ // Check immediately: polling assertions can outlast the 1s copied reset timer.505+ expect(copyButton().element().hasAttribute("disabled")).toBe(false);
juliusmarminge added labelstakeover:in-progress
Pushed89994a6
juliusmarminge added labelstakeover:blocked
juliusmarminge removed labelstakeover:in-progress
only21mil(GitHub profile, opens in a new tab) closed this
Sign in to join this conversation.


macroscopeapp[bot](GitHub profile, opens in a new tab) approved these changes