@@ -21,26 +21,41 @@ void main() {
21
21
group ('MatrixService Tests' , () {
22
22
final mockLoggingDb = MockLoggingDb ();
23
23
final secureStorageMock = MockSecureStorage ();
24
- const testUserEnv = 'TEST_USER' ;
24
+ const testUserEnv1 = 'TEST_USER1' ;
25
+ const testUserEnv2 = 'TEST_USER2' ;
25
26
const testServerEnv = 'TEST_SERVER' ;
26
27
const testPasswordEnv = 'TEST_PASSWORD' ;
27
28
const testSlowNetworkEnv = 'SLOW_NETWORK' ;
28
29
29
- if (! const bool .hasEnvironment (testUserEnv )) {
30
- debugPrint ('TEST_USER not defined!!! Run via run_matrix_tests.sh' );
30
+ if (! const bool .hasEnvironment (testUserEnv1 )) {
31
+ debugPrint ('TEST_USER1 not defined!!! Run via run_matrix_tests.sh' );
31
32
exit (1 );
32
33
}
33
- const testUserName = String .fromEnvironment (testUserEnv);
34
+
35
+ if (! const bool .hasEnvironment (testUserEnv2)) {
36
+ debugPrint ('TEST_USER2 not defined!!! Run via run_matrix_tests.sh' );
37
+ exit (1 );
38
+ }
39
+
40
+ const testUserName1 = String .fromEnvironment (testUserEnv1);
41
+ const testUserName2 = String .fromEnvironment (testUserEnv1);
42
+
34
43
const testHomeServer = bool .hasEnvironment (testServerEnv)
35
44
? String .fromEnvironment (testServerEnv)
36
45
: 'http://localhost:8008' ;
37
46
const testPassword = bool .hasEnvironment (testPasswordEnv)
38
47
? String .fromEnvironment (testPasswordEnv)
39
48
: '?Secret123@!' ;
40
49
41
- const config = MatrixConfig (
50
+ const config1 = MatrixConfig (
42
51
homeServer: testHomeServer,
43
- user: testUserName,
52
+ user: testUserName1,
53
+ password: testPassword,
54
+ );
55
+
56
+ const config2 = MatrixConfig (
57
+ homeServer: testHomeServer,
58
+ user: testUserName2,
44
59
password: testPassword,
45
60
);
46
61
@@ -67,7 +82,7 @@ void main() {
67
82
() async {
68
83
debugPrint ('\n --- AliceDevice goes live' );
69
84
final aliceDevice = MatrixService (
70
- matrixConfig: config ,
85
+ matrixConfig: config1 ,
71
86
hiveDbName: 'AliceDevice' ,
72
87
deviceDisplayName: 'AliceDevice' ,
73
88
);
@@ -89,7 +104,7 @@ void main() {
89
104
90
105
debugPrint ('\n --- BobDevice goes live' );
91
106
final bobDevice = MatrixService (
92
- matrixConfig: config ,
107
+ matrixConfig: config2 ,
93
108
hiveDbName: 'BobDevice' ,
94
109
deviceDisplayName: 'BobDevice' ,
95
110
);
@@ -101,14 +116,18 @@ void main() {
101
116
final joinRes2 = await bobDevice.joinRoom (roomId);
102
117
debugPrint ('BobDevice - room joined: $joinRes2 ' );
103
118
119
+ await Future <void >.delayed (
120
+ const Duration (seconds: 1 * delayFactor),
121
+ );
122
+
104
123
await waitUntil (() => aliceDevice.getUnverified ().length == 1 );
105
124
await waitUntil (() => bobDevice.getUnverified ().length == 1 );
106
125
107
126
final unverifiedAlice = aliceDevice.getUnverified ();
108
127
final unverifiedBob = bobDevice.getUnverified ();
109
128
110
- debugPrint ('AliceDevice - unverified: $unverifiedAlice ' );
111
- debugPrint ('BobDevice - unverified: $unverifiedBob ' );
129
+ debugPrint ('\n AliceDevice - unverified: $unverifiedAlice ' );
130
+ debugPrint ('\n BobDevice - unverified: $unverifiedBob ' );
112
131
113
132
expect (unverifiedAlice.length, 1 );
114
133
expect (unverifiedBob.length, 1 );
0 commit comments