@remit/ui 0.0.216 → 0.0.217
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
2
|
import { type ReactNode, useState } from "react";
|
|
3
|
+
import { expect, userEvent, within } from "storybook/test";
|
|
3
4
|
import type { RsvpState } from "./calendar-types.js";
|
|
4
5
|
import type { IntelligenceCalendarData } from "./intelligence-calendar.js";
|
|
5
6
|
import {
|
|
@@ -114,6 +115,11 @@ function PanelDemo({
|
|
|
114
115
|
onMuteInvite: () => setRemoved(true),
|
|
115
116
|
onOfferOtherTimes: () => setOffering(true),
|
|
116
117
|
onRemoveInvite: () => setRemoved(true),
|
|
118
|
+
onOpenNewerInvite:
|
|
119
|
+
calendar.invite?.invite.state === "superseded"
|
|
120
|
+
? () =>
|
|
121
|
+
setLastAction("opened the newer revision's conversation")
|
|
122
|
+
: undefined,
|
|
117
123
|
onToggleSlot: (slot) => {
|
|
118
124
|
setPicked((prev) =>
|
|
119
125
|
prev.includes(slot.startTime)
|
|
@@ -374,13 +380,20 @@ export const InviteWithNothingBooked = rail(
|
|
|
374
380
|
* A later message carried a higher SEQUENCE for the same UID. The stale one is
|
|
375
381
|
* dimmed and its buttons are gone: answering a revision that has been replaced
|
|
376
382
|
* puts the wrong hour on the calendar, so the card offers the newer one instead
|
|
377
|
-
* of an answer.
|
|
383
|
+
* of an answer, and pressing it opens the conversation that carries it.
|
|
378
384
|
*/
|
|
379
|
-
export const SupersededInvitation =
|
|
380
|
-
KICKOFF,
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
385
|
+
export const SupersededInvitation: Story = {
|
|
386
|
+
...rail(KICKOFF, organiserSender, supersededInvite),
|
|
387
|
+
play: async ({ canvasElement }) => {
|
|
388
|
+
const canvas = within(canvasElement);
|
|
389
|
+
await userEvent.click(
|
|
390
|
+
canvas.getByRole("button", { name: "Open the newer invitation" }),
|
|
391
|
+
);
|
|
392
|
+
await expect(
|
|
393
|
+
canvas.getByText("Prototype: opened the newer revision's conversation"),
|
|
394
|
+
).toBeVisible();
|
|
395
|
+
},
|
|
396
|
+
};
|
|
384
397
|
|
|
385
398
|
/**
|
|
386
399
|
* METHOD:CANCEL on something already accepted. Reader does not take it off by
|