@@ -116,21 +116,21 @@ void main() {
116116 .equals (UserTopicVisibilityPolicy .none);
117117 });
118118
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);
122122 check (store.topicVisibilityPolicy (stream1.streamId, 'topic' ))
123123 .equals (UserTopicVisibilityPolicy .none);
124124 });
125125
126- test ('with topic present' , () {
126+ test ('with topic present' , () async {
127127 final store = eg.store ();
128128 for (final policy in [
129129 UserTopicVisibilityPolicy .muted,
130130 UserTopicVisibilityPolicy .unmuted,
131131 UserTopicVisibilityPolicy .followed,
132132 ]) {
133- store.addUserTopic (stream1, 'topic' , policy);
133+ await store.addUserTopic (stream1, 'topic' , policy);
134134 check (store.topicVisibilityPolicy (stream1.streamId, 'topic' ))
135135 .equals (policy);
136136 }
@@ -165,7 +165,7 @@ void main() {
165165 final store = eg.store ();
166166 await store.addStream (stream1);
167167 await store.addSubscription (eg.subscription (stream1));
168- store.addUserTopic (stream1, 'topic' , UserTopicVisibilityPolicy .muted);
168+ await store.addUserTopic (stream1, 'topic' , UserTopicVisibilityPolicy .muted);
169169 check (store.isTopicVisibleInStream (stream1.streamId, 'topic' )).isFalse ();
170170 check (store.isTopicVisible (stream1.streamId, 'topic' )).isFalse ();
171171 });
@@ -174,7 +174,7 @@ void main() {
174174 final store = eg.store ();
175175 await store.addStream (stream1);
176176 await store.addSubscription (eg.subscription (stream1, isMuted: true ));
177- store.addUserTopic (stream1, 'topic' , UserTopicVisibilityPolicy .unmuted);
177+ await store.addUserTopic (stream1, 'topic' , UserTopicVisibilityPolicy .unmuted);
178178 check (store.isTopicVisibleInStream (stream1.streamId, 'topic' )).isTrue ();
179179 check (store.isTopicVisible (stream1.streamId, 'topic' )).isTrue ();
180180 });
@@ -183,7 +183,7 @@ void main() {
183183 final store = eg.store ();
184184 await store.addStream (stream1);
185185 await store.addSubscription (eg.subscription (stream1, isMuted: true ));
186- store.addUserTopic (stream1, 'topic' , UserTopicVisibilityPolicy .followed);
186+ await store.addUserTopic (stream1, 'topic' , UserTopicVisibilityPolicy .followed);
187187 check (store.isTopicVisibleInStream (stream1.streamId, 'topic' )).isTrue ();
188188 check (store.isTopicVisible (stream1.streamId, 'topic' )).isTrue ();
189189 });
@@ -229,55 +229,55 @@ void main() {
229229 });
230230
231231 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);
235235 compareTopicVisibility (store, [
236236 makeUserTopicItem (stream1, 'topic' , UserTopicVisibilityPolicy .muted),
237237 ]);
238238 });
239239
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);
244244 compareTopicVisibility (store, [
245245 makeUserTopicItem (stream1, 'topic' , UserTopicVisibilityPolicy .muted),
246246 makeUserTopicItem (stream1, 'other topic' , UserTopicVisibilityPolicy .unmuted),
247247 ]);
248248 });
249249
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);
254254 compareTopicVisibility (store, [
255255 makeUserTopicItem (stream1, 'topic' , UserTopicVisibilityPolicy .unmuted),
256256 ]);
257257 });
258258
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);
264264 compareTopicVisibility (store, [
265265 makeUserTopicItem (stream1, 'other topic' , UserTopicVisibilityPolicy .unmuted),
266266 ]);
267267 });
268268
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);
273273 compareTopicVisibility (store, [
274274 ]);
275275 });
276276
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);
281281 compareTopicVisibility (store, [
282282 ]);
283283 });
0 commit comments