@@ -210,19 +210,30 @@ async fn test_decode_smtp() -> Result<()> {
210
210
211
211
#[ tokio:: test( flavor = "multi_thread" , worker_threads = 2 ) ]
212
212
async fn test_decode_ideltachat_link ( ) -> Result < ( ) > {
213
- let ctx = TestContext :: new_alice ( ) . await ;
214
-
215
- let qr = check_qr (
216
- & ctx. ctx ,
217
- "https://i.delta.chat/#79252762C34C5096AF57958F4FC3D21A81B0F0A7&a=cli%40deltachat.de&g=test%20%3F+test%20%21&x=h-0oKQf2CDK&i=9JEXlxAqGM0&s=0V7LzL9cxRL"
218
- ) . await ?;
219
- assert ! ( matches!( qr, Qr :: AskVerifyGroup { .. } ) ) ;
220
-
221
- let qr = check_qr (
222
- & ctx. ctx ,
223
- "https://i.delta.chat#79252762C34C5096AF57958F4FC3D21A81B0F0A7&a=cli%40deltachat.de&g=test%20%3F+test%20%21&x=h-0oKQf2CDK&i=9JEXlxAqGM0&s=0V7LzL9cxRL"
224
- ) . await ?;
225
- assert ! ( matches!( qr, Qr :: AskVerifyGroup { .. } ) ) ;
213
+ let mut tcm = TestContextManager :: new ( ) ;
214
+ let ctx_configured = & tcm. alice ( ) . await ;
215
+
216
+ // Explicitly test that scanning QR codes works
217
+ // with unconfigured accounts.
218
+ // This is needed for the flow where
219
+ // user scans a QR code or follows invite link
220
+ // and then creates a profile and e.g. joins a group
221
+ // at the same time.
222
+ let ctx_unconfigured = & tcm. unconfigured ( ) . await ;
223
+
224
+ for ctx in & [ ctx_configured, ctx_unconfigured] {
225
+ let qr = check_qr (
226
+ ctx,
227
+ "https://i.delta.chat/#79252762C34C5096AF57958F4FC3D21A81B0F0A7&a=cli%40deltachat.de&g=test%20%3F+test%20%21&x=h-0oKQf2CDK&i=9JEXlxAqGM0&s=0V7LzL9cxRL"
228
+ ) . await ?;
229
+ assert ! ( matches!( qr, Qr :: AskVerifyGroup { .. } ) ) ;
230
+
231
+ let qr = check_qr (
232
+ ctx,
233
+ "https://i.delta.chat#79252762C34C5096AF57958F4FC3D21A81B0F0A7&a=cli%40deltachat.de&g=test%20%3F+test%20%21&x=h-0oKQf2CDK&i=9JEXlxAqGM0&s=0V7LzL9cxRL"
234
+ ) . await ?;
235
+ assert ! ( matches!( qr, Qr :: AskVerifyGroup { .. } ) ) ;
236
+ }
226
237
227
238
Ok ( ( ) )
228
239
}
0 commit comments