@@ -42,14 +42,20 @@ void main() {
42
42
)));
43
43
});
44
44
45
- test ('added by events' , () {
45
+ test ('added by events' , () async {
46
46
final stream1 = eg.stream (streamId: 1 , name: 'stream 1' );
47
47
final stream2 = eg.stream (streamId: 2 , name: 'stream 2' );
48
48
final store = eg.store ();
49
49
checkUnified (store);
50
- checkUnified (store..addStream (stream1));
51
- checkUnified (store..addStream (stream2));
52
- checkUnified (store..addSubscription (eg.subscription (stream1)));
50
+
51
+ await store.addStream (stream1);
52
+ checkUnified (store);
53
+
54
+ await store.addStream (stream2);
55
+ checkUnified (store);
56
+
57
+ store.addSubscription (eg.subscription (stream1));
58
+ checkUnified (store);
53
59
});
54
60
});
55
61
@@ -132,46 +138,52 @@ void main() {
132
138
});
133
139
134
140
group ('isTopicVisible/InStream' , () {
135
- test ('with policy none, stream not muted' , () {
136
- final store = eg.store ()..addStream (stream1)
137
- ..addSubscription (eg.subscription (stream1));
141
+ test ('with policy none, stream not muted' , () async {
142
+ final store = eg.store ();
143
+ await store.addStream (stream1);
144
+ store.addSubscription (eg.subscription (stream1));
138
145
check (store.isTopicVisibleInStream (stream1.streamId, 'topic' )).isTrue ();
139
146
check (store.isTopicVisible (stream1.streamId, 'topic' )).isTrue ();
140
147
});
141
148
142
- test ('with policy none, stream muted' , () {
143
- final store = eg.store ()..addStream (stream1)
144
- ..addSubscription (eg.subscription (stream1, isMuted: true ));
149
+ test ('with policy none, stream muted' , () async {
150
+ final store = eg.store ();
151
+ await store.addStream (stream1);
152
+ store.addSubscription (eg.subscription (stream1, isMuted: true ));
145
153
check (store.isTopicVisibleInStream (stream1.streamId, 'topic' )).isTrue ();
146
154
check (store.isTopicVisible (stream1.streamId, 'topic' )).isFalse ();
147
155
});
148
156
149
- test ('with policy none, stream unsubscribed' , () {
150
- final store = eg.store ()..addStream (stream1);
157
+ test ('with policy none, stream unsubscribed' , () async {
158
+ final store = eg.store ();
159
+ await store.addStream (stream1);
151
160
check (store.isTopicVisibleInStream (stream1.streamId, 'topic' )).isTrue ();
152
161
check (store.isTopicVisible (stream1.streamId, 'topic' )).isFalse ();
153
162
});
154
163
155
- test ('with policy muted' , () {
156
- final store = eg.store ()..addStream (stream1)
157
- ..addSubscription (eg.subscription (stream1))
158
- ..addUserTopic (stream1, 'topic' , UserTopicVisibilityPolicy .muted);
164
+ test ('with policy muted' , () async {
165
+ final store = eg.store ();
166
+ await store.addStream (stream1);
167
+ store.addSubscription (eg.subscription (stream1));
168
+ store.addUserTopic (stream1, 'topic' , UserTopicVisibilityPolicy .muted);
159
169
check (store.isTopicVisibleInStream (stream1.streamId, 'topic' )).isFalse ();
160
170
check (store.isTopicVisible (stream1.streamId, 'topic' )).isFalse ();
161
171
});
162
172
163
- test ('with policy unmuted' , () {
164
- final store = eg.store ()..addStream (stream1)
165
- ..addSubscription (eg.subscription (stream1, isMuted: true ))
166
- ..addUserTopic (stream1, 'topic' , UserTopicVisibilityPolicy .unmuted);
173
+ test ('with policy unmuted' , () async {
174
+ final store = eg.store ();
175
+ await store.addStream (stream1);
176
+ store.addSubscription (eg.subscription (stream1, isMuted: true ));
177
+ store.addUserTopic (stream1, 'topic' , UserTopicVisibilityPolicy .unmuted);
167
178
check (store.isTopicVisibleInStream (stream1.streamId, 'topic' )).isTrue ();
168
179
check (store.isTopicVisible (stream1.streamId, 'topic' )).isTrue ();
169
180
});
170
181
171
- test ('with policy followed' , () {
172
- final store = eg.store ()..addStream (stream1)
173
- ..addSubscription (eg.subscription (stream1, isMuted: true ))
174
- ..addUserTopic (stream1, 'topic' , UserTopicVisibilityPolicy .followed);
182
+ test ('with policy followed' , () async {
183
+ final store = eg.store ();
184
+ await store.addStream (stream1);
185
+ store.addSubscription (eg.subscription (stream1, isMuted: true ));
186
+ store.addUserTopic (stream1, 'topic' , UserTopicVisibilityPolicy .followed);
175
187
check (store.isTopicVisibleInStream (stream1.streamId, 'topic' )).isTrue ();
176
188
check (store.isTopicVisible (stream1.streamId, 'topic' )).isTrue ();
177
189
});
0 commit comments