@@ -8,6 +8,7 @@ import { installMockBridge } from "../helpers/bridge";
88
99const DEFAULT_MOCK_PUBKEY = "deadbeef" . repeat ( 8 ) ;
1010const TRANSACTION_STORAGE_KEY = "buzz-community-onboarding-transaction.v1" ;
11+ const COMMUNITY_RELAY_URL = "wss://hive.example.com" ;
1112
1213const PENDING_JOIN_LINK = {
1314 id : "dl-join-1" ,
@@ -91,6 +92,70 @@ test("connect deep link shows a static acknowledgment during setup", async ({
9192 . toContain ( '"acknowledged":true' ) ;
9293} ) ;
9394
95+ test ( "Welcome failure can be skipped without abandoning community onboarding" , async ( {
96+ page,
97+ } ) => {
98+ const welcomeError = "Channel creation is not permitted." ;
99+ await page . addInitScript (
100+ ( { pubkey, relayUrl, storageKey } ) => {
101+ window . localStorage . setItem (
102+ `buzz-machine-onboarding-complete.v2:${ pubkey } ` ,
103+ "true" ,
104+ ) ;
105+ const timestamp = new Date ( ) . toISOString ( ) ;
106+ window . localStorage . setItem (
107+ storageKey ,
108+ JSON . stringify ( {
109+ id : "txn-welcome-failure-1" ,
110+ source : "deep-link-join" ,
111+ stage : "team-intro" ,
112+ relayUrl,
113+ communityName : "hive" ,
114+ communityId : "e2e-default-community" ,
115+ createdAt : timestamp ,
116+ updatedAt : timestamp ,
117+ } ) ,
118+ ) ;
119+ } ,
120+ {
121+ pubkey : DEFAULT_MOCK_PUBKEY ,
122+ relayUrl : COMMUNITY_RELAY_URL ,
123+ storageKey : TRANSACTION_STORAGE_KEY ,
124+ } ,
125+ ) ;
126+ await installMockBridge (
127+ page ,
128+ { createChannelErrors : [ welcomeError , welcomeError ] } ,
129+ { relayWsUrl : COMMUNITY_RELAY_URL , skipOnboardingSeed : true } ,
130+ ) ;
131+ await page . goto ( "/" ) ;
132+
133+ await page . getByRole ( "button" , { name : "Enter hive" } ) . click ( ) ;
134+
135+ await expect ( page . getByText ( welcomeError ) ) . toBeVisible ( ) ;
136+ await expect (
137+ page . getByRole ( "button" , { name : "Preparing Welcome…" } ) ,
138+ ) . toBeEnabled ( ) ;
139+ const skip = page . getByRole ( "button" , { name : "Skip for now" } ) ;
140+ await expect ( skip ) . toBeVisible ( ) ;
141+ await skip . click ( ) ;
142+
143+ const completionKey = `buzz-community-onboarding-complete.v1:${ encodeURIComponent ( COMMUNITY_RELAY_URL ) } :${ DEFAULT_MOCK_PUBKEY } ` ;
144+ await expect
145+ . poll ( ( ) =>
146+ page . evaluate (
147+ ( { completion, transaction } ) => ( {
148+ completion : window . localStorage . getItem ( completion ) ,
149+ transaction : window . localStorage . getItem ( transaction ) ,
150+ } ) ,
151+ { completion : completionKey , transaction : TRANSACTION_STORAGE_KEY } ,
152+ ) ,
153+ )
154+ . toEqual ( { completion : "true" , transaction : null } ) ;
155+ await expect ( page . getByTestId ( "community-onboarding-flow" ) ) . toHaveCount ( 0 ) ;
156+ await expect ( page . getByTestId ( "app-sidebar" ) ) . toBeVisible ( ) ;
157+ } ) ;
158+
94159test ( "persisted deep-link invite hands off to Joining after machine onboarding" , async ( {
95160 page,
96161} ) => {
0 commit comments