|
1 | 1 | import { expect, test } from "@playwright/test"; |
2 | 2 |
|
3 | | -import { KIND_TYPING_INDICATOR } from "../../src/shared/constants/kinds"; |
| 3 | +import { |
| 4 | + KIND_HUDDLE_ENDED, |
| 5 | + KIND_HUDDLE_STARTED, |
| 6 | + KIND_TYPING_INDICATOR, |
| 7 | +} from "../../src/shared/constants/kinds"; |
4 | 8 | import { |
5 | 9 | TEST_IDENTITIES, |
6 | 10 | installMockBridge, |
@@ -2879,6 +2883,58 @@ test("channel header omits the add agent action", async ({ page }) => { |
2879 | 2883 | await expect(page.getByTestId("channel-management-trigger")).toBeVisible(); |
2880 | 2884 | }); |
2881 | 2885 |
|
| 2886 | +test("huddle rollback end event clears the active header action", async ({ |
| 2887 | + page, |
| 2888 | +}) => { |
| 2889 | + await page.goto("/"); |
| 2890 | + await page.getByTestId("channel-random").click(); |
| 2891 | + await expect(page.getByTestId("chat-title")).toHaveText("random"); |
| 2892 | + await waitForMockLiveSubscription(page, "random", KIND_HUDDLE_STARTED); |
| 2893 | + |
| 2894 | + const ephemeralChannelId = "10000000-0000-4000-8000-000000000001"; |
| 2895 | + const createdAt = Math.floor(Date.now() / 1000); |
| 2896 | + |
| 2897 | + await page.evaluate( |
| 2898 | + ({ createdAt, ephemeralChannelId, kind }) => { |
| 2899 | + window.__BUZZ_E2E_EMIT_MOCK_MESSAGE__?.({ |
| 2900 | + channelName: "random", |
| 2901 | + content: JSON.stringify({ |
| 2902 | + ephemeral_channel_id: ephemeralChannelId, |
| 2903 | + }), |
| 2904 | + createdAt, |
| 2905 | + id: "1".repeat(64), |
| 2906 | + kind, |
| 2907 | + }); |
| 2908 | + }, |
| 2909 | + { createdAt, ephemeralChannelId, kind: KIND_HUDDLE_STARTED }, |
| 2910 | + ); |
| 2911 | + |
| 2912 | + await expect( |
| 2913 | + page.getByRole("button", { |
| 2914 | + name: "Join active huddle (1 participant)", |
| 2915 | + }), |
| 2916 | + ).toBeVisible(); |
| 2917 | + |
| 2918 | + await page.evaluate( |
| 2919 | + ({ createdAt, ephemeralChannelId, kind }) => { |
| 2920 | + window.__BUZZ_E2E_EMIT_MOCK_MESSAGE__?.({ |
| 2921 | + channelName: "random", |
| 2922 | + content: JSON.stringify({ |
| 2923 | + ephemeral_channel_id: ephemeralChannelId, |
| 2924 | + }), |
| 2925 | + createdAt, |
| 2926 | + id: "2".repeat(64), |
| 2927 | + kind, |
| 2928 | + }); |
| 2929 | + }, |
| 2930 | + { createdAt, ephemeralChannelId, kind: KIND_HUDDLE_ENDED }, |
| 2931 | + ); |
| 2932 | + |
| 2933 | + await expect( |
| 2934 | + page.getByTestId("channel-start-huddle-trigger"), |
| 2935 | + ).toHaveAttribute("aria-label", "Start huddle"); |
| 2936 | +}); |
| 2937 | + |
2882 | 2938 | test("channel header actions show tooltips", async ({ page }) => { |
2883 | 2939 | await page.goto("/"); |
2884 | 2940 | await page.getByTestId("channel-random").click(); |
|
0 commit comments