File tree Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -129,9 +129,20 @@ export async function createNewProfile(
129
129
// create a new account
130
130
await page . getByTestId ( 'create-account-button' ) . click ( )
131
131
132
- const dcAccountLink = useChatmail
133
- ? `dcaccount:${ chatmailServerUrl } /new`
134
- : `dcaccount:${ mailServerUrl } //new_email?t=${ mailServerToken } &n=ci_github`
132
+ let dcAccountLink : string
133
+ if ( useChatmail ) {
134
+ if ( ! chatmailServerUrl ) {
135
+ throw new Error ( 'DC_CHATMAIL_SERVER env var not set, cannot run tests' )
136
+ }
137
+ dcAccountLink = `dcaccount:${ chatmailServerUrl satisfies string } /new`
138
+ } else {
139
+ if ( ! mailServerUrl || mailServerToken == undefined ) {
140
+ throw new Error (
141
+ 'DC_MAIL_SERVER or DC_MAIL_SERVER_TOKEN env var not set, cannot run tests'
142
+ )
143
+ }
144
+ dcAccountLink = `dcaccount:${ mailServerUrl satisfies string } //new_email?t=${ mailServerToken satisfies string } &n=ci_github`
145
+ }
135
146
await page . evaluate ( `navigator.clipboard.writeText('${ dcAccountLink } ')` )
136
147
await clickThroughTestIds ( page , [
137
148
'other-login-button' ,
You can’t perform that action at this time.
0 commit comments