@@ -116,21 +116,21 @@ void main() {
116
116
.equals (UserTopicVisibilityPolicy .none);
117
117
});
118
118
119
- test ('with nothing for topic' , () {
120
- final store = eg.store ()
121
- . .addUserTopic (stream1, 'other topic' , UserTopicVisibilityPolicy .muted);
119
+ test ('with nothing for topic' , () async {
120
+ final store = eg.store ();
121
+ await store .addUserTopic (stream1, 'other topic' , UserTopicVisibilityPolicy .muted);
122
122
check (store.topicVisibilityPolicy (stream1.streamId, 'topic' ))
123
123
.equals (UserTopicVisibilityPolicy .none);
124
124
});
125
125
126
- test ('with topic present' , () {
126
+ test ('with topic present' , () async {
127
127
final store = eg.store ();
128
128
for (final policy in [
129
129
UserTopicVisibilityPolicy .muted,
130
130
UserTopicVisibilityPolicy .unmuted,
131
131
UserTopicVisibilityPolicy .followed,
132
132
]) {
133
- store.addUserTopic (stream1, 'topic' , policy);
133
+ await store.addUserTopic (stream1, 'topic' , policy);
134
134
check (store.topicVisibilityPolicy (stream1.streamId, 'topic' ))
135
135
.equals (policy);
136
136
}
@@ -165,7 +165,7 @@ void main() {
165
165
final store = eg.store ();
166
166
await store.addStream (stream1);
167
167
await store.addSubscription (eg.subscription (stream1));
168
- store.addUserTopic (stream1, 'topic' , UserTopicVisibilityPolicy .muted);
168
+ await store.addUserTopic (stream1, 'topic' , UserTopicVisibilityPolicy .muted);
169
169
check (store.isTopicVisibleInStream (stream1.streamId, 'topic' )).isFalse ();
170
170
check (store.isTopicVisible (stream1.streamId, 'topic' )).isFalse ();
171
171
});
@@ -174,7 +174,7 @@ void main() {
174
174
final store = eg.store ();
175
175
await store.addStream (stream1);
176
176
await store.addSubscription (eg.subscription (stream1, isMuted: true ));
177
- store.addUserTopic (stream1, 'topic' , UserTopicVisibilityPolicy .unmuted);
177
+ await store.addUserTopic (stream1, 'topic' , UserTopicVisibilityPolicy .unmuted);
178
178
check (store.isTopicVisibleInStream (stream1.streamId, 'topic' )).isTrue ();
179
179
check (store.isTopicVisible (stream1.streamId, 'topic' )).isTrue ();
180
180
});
@@ -183,7 +183,7 @@ void main() {
183
183
final store = eg.store ();
184
184
await store.addStream (stream1);
185
185
await store.addSubscription (eg.subscription (stream1, isMuted: true ));
186
- store.addUserTopic (stream1, 'topic' , UserTopicVisibilityPolicy .followed);
186
+ await store.addUserTopic (stream1, 'topic' , UserTopicVisibilityPolicy .followed);
187
187
check (store.isTopicVisibleInStream (stream1.streamId, 'topic' )).isTrue ();
188
188
check (store.isTopicVisible (stream1.streamId, 'topic' )).isTrue ();
189
189
});
@@ -229,55 +229,55 @@ void main() {
229
229
});
230
230
231
231
group ('events' , () {
232
- test ('add with new stream' , () {
233
- final store = eg.store ()
234
- . .addUserTopic (stream1, 'topic' , UserTopicVisibilityPolicy .muted);
232
+ test ('add with new stream' , () async {
233
+ final store = eg.store ();
234
+ await store .addUserTopic (stream1, 'topic' , UserTopicVisibilityPolicy .muted);
235
235
compareTopicVisibility (store, [
236
236
makeUserTopicItem (stream1, 'topic' , UserTopicVisibilityPolicy .muted),
237
237
]);
238
238
});
239
239
240
- test ('add in existing stream' , () {
241
- final store = eg.store ()
242
- .. addUserTopic (stream1, 'topic' , UserTopicVisibilityPolicy .muted)
243
- . .addUserTopic (stream1, 'other topic' , UserTopicVisibilityPolicy .unmuted);
240
+ test ('add in existing stream' , () async {
241
+ final store = eg.store ();
242
+ await store. addUserTopic (stream1, 'topic' , UserTopicVisibilityPolicy .muted);
243
+ await store .addUserTopic (stream1, 'other topic' , UserTopicVisibilityPolicy .unmuted);
244
244
compareTopicVisibility (store, [
245
245
makeUserTopicItem (stream1, 'topic' , UserTopicVisibilityPolicy .muted),
246
246
makeUserTopicItem (stream1, 'other topic' , UserTopicVisibilityPolicy .unmuted),
247
247
]);
248
248
});
249
249
250
- test ('update existing policy' , () {
251
- final store = eg.store ()
252
- .. addUserTopic (stream1, 'topic' , UserTopicVisibilityPolicy .muted)
253
- . .addUserTopic (stream1, 'topic' , UserTopicVisibilityPolicy .unmuted);
250
+ test ('update existing policy' , () async {
251
+ final store = eg.store ();
252
+ await store. addUserTopic (stream1, 'topic' , UserTopicVisibilityPolicy .muted);
253
+ await store .addUserTopic (stream1, 'topic' , UserTopicVisibilityPolicy .unmuted);
254
254
compareTopicVisibility (store, [
255
255
makeUserTopicItem (stream1, 'topic' , UserTopicVisibilityPolicy .unmuted),
256
256
]);
257
257
});
258
258
259
- test ('remove, with others in stream' , () {
260
- final store = eg.store ()
261
- .. addUserTopic (stream1, 'topic' , UserTopicVisibilityPolicy .muted)
262
- .. addUserTopic (stream1, 'other topic' , UserTopicVisibilityPolicy .unmuted)
263
- . .addUserTopic (stream1, 'topic' , UserTopicVisibilityPolicy .none);
259
+ test ('remove, with others in stream' , () async {
260
+ final store = eg.store ();
261
+ await store. addUserTopic (stream1, 'topic' , UserTopicVisibilityPolicy .muted);
262
+ await store. addUserTopic (stream1, 'other topic' , UserTopicVisibilityPolicy .unmuted);
263
+ await store .addUserTopic (stream1, 'topic' , UserTopicVisibilityPolicy .none);
264
264
compareTopicVisibility (store, [
265
265
makeUserTopicItem (stream1, 'other topic' , UserTopicVisibilityPolicy .unmuted),
266
266
]);
267
267
});
268
268
269
- test ('remove, as last in stream' , () {
270
- final store = eg.store ()
271
- .. addUserTopic (stream1, 'topic' , UserTopicVisibilityPolicy .muted)
272
- . .addUserTopic (stream1, 'topic' , UserTopicVisibilityPolicy .none);
269
+ test ('remove, as last in stream' , () async {
270
+ final store = eg.store ();
271
+ await store. addUserTopic (stream1, 'topic' , UserTopicVisibilityPolicy .muted);
272
+ await store .addUserTopic (stream1, 'topic' , UserTopicVisibilityPolicy .none);
273
273
compareTopicVisibility (store, [
274
274
]);
275
275
});
276
276
277
- test ('treat unknown enum value as removing' , () {
278
- final store = eg.store ()
279
- .. addUserTopic (stream1, 'topic' , UserTopicVisibilityPolicy .muted)
280
- . .addUserTopic (stream1, 'topic' , UserTopicVisibilityPolicy .unknown);
277
+ test ('treat unknown enum value as removing' , () async {
278
+ final store = eg.store ();
279
+ await store. addUserTopic (stream1, 'topic' , UserTopicVisibilityPolicy .muted);
280
+ await store .addUserTopic (stream1, 'topic' , UserTopicVisibilityPolicy .unknown);
281
281
compareTopicVisibility (store, [
282
282
]);
283
283
});
0 commit comments