@@ -148,7 +148,7 @@ void main() {
148148
149149 test ('with nothing for topic' , () async {
150150 final store = eg.store ();
151- await store.addUserTopic (stream1, 'other topic' , UserTopicVisibilityPolicy .muted);
151+ await store.setUserTopic (stream1, 'other topic' , UserTopicVisibilityPolicy .muted);
152152 check (store.topicVisibilityPolicy (stream1.streamId, eg.t ('topic' )))
153153 .equals (UserTopicVisibilityPolicy .none);
154154 });
@@ -160,7 +160,7 @@ void main() {
160160 UserTopicVisibilityPolicy .unmuted,
161161 UserTopicVisibilityPolicy .followed,
162162 ]) {
163- await store.addUserTopic (stream1, 'topic' , policy);
163+ await store.setUserTopic (stream1, 'topic' , policy);
164164 check (store.topicVisibilityPolicy (stream1.streamId, eg.t ('topic' )))
165165 .equals (policy);
166166 }
@@ -195,7 +195,7 @@ void main() {
195195 final store = eg.store ();
196196 await store.addStream (stream1);
197197 await store.addSubscription (eg.subscription (stream1));
198- await store.addUserTopic (stream1, 'topic' , UserTopicVisibilityPolicy .muted);
198+ await store.setUserTopic (stream1, 'topic' , UserTopicVisibilityPolicy .muted);
199199 check (store.isTopicVisibleInStream (stream1.streamId, eg.t ('topic' ))).isFalse ();
200200 check (store.isTopicVisible (stream1.streamId, eg.t ('topic' ))).isFalse ();
201201 });
@@ -204,7 +204,7 @@ void main() {
204204 final store = eg.store ();
205205 await store.addStream (stream1);
206206 await store.addSubscription (eg.subscription (stream1, isMuted: true ));
207- await store.addUserTopic (stream1, 'topic' , UserTopicVisibilityPolicy .unmuted);
207+ await store.setUserTopic (stream1, 'topic' , UserTopicVisibilityPolicy .unmuted);
208208 check (store.isTopicVisibleInStream (stream1.streamId, eg.t ('topic' ))).isTrue ();
209209 check (store.isTopicVisible (stream1.streamId, eg.t ('topic' ))).isTrue ();
210210 });
@@ -213,7 +213,7 @@ void main() {
213213 final store = eg.store ();
214214 await store.addStream (stream1);
215215 await store.addSubscription (eg.subscription (stream1, isMuted: true ));
216- await store.addUserTopic (stream1, 'topic' , UserTopicVisibilityPolicy .followed);
216+ await store.setUserTopic (stream1, 'topic' , UserTopicVisibilityPolicy .followed);
217217 check (store.isTopicVisibleInStream (stream1.streamId, eg.t ('topic' ))).isTrue ();
218218 check (store.isTopicVisible (stream1.streamId, eg.t ('topic' ))).isTrue ();
219219 });
@@ -342,16 +342,16 @@ void main() {
342342 group ('events' , () {
343343 test ('add with new stream' , () async {
344344 final store = eg.store ();
345- await store.addUserTopic (stream1, 'topic' , UserTopicVisibilityPolicy .muted);
345+ await store.setUserTopic (stream1, 'topic' , UserTopicVisibilityPolicy .muted);
346346 compareTopicVisibility (store, [
347347 eg.userTopicItem (stream1, 'topic' , UserTopicVisibilityPolicy .muted),
348348 ]);
349349 });
350350
351351 test ('add in existing stream' , () async {
352352 final store = eg.store ();
353- await store.addUserTopic (stream1, 'topic' , UserTopicVisibilityPolicy .muted);
354- await store.addUserTopic (stream1, 'other topic' , UserTopicVisibilityPolicy .unmuted);
353+ await store.setUserTopic (stream1, 'topic' , UserTopicVisibilityPolicy .muted);
354+ await store.setUserTopic (stream1, 'other topic' , UserTopicVisibilityPolicy .unmuted);
355355 compareTopicVisibility (store, [
356356 eg.userTopicItem (stream1, 'topic' , UserTopicVisibilityPolicy .muted),
357357 eg.userTopicItem (stream1, 'other topic' , UserTopicVisibilityPolicy .unmuted),
@@ -360,35 +360,35 @@ void main() {
360360
361361 test ('update existing policy' , () async {
362362 final store = eg.store ();
363- await store.addUserTopic (stream1, 'topic' , UserTopicVisibilityPolicy .muted);
364- await store.addUserTopic (stream1, 'topic' , UserTopicVisibilityPolicy .unmuted);
363+ await store.setUserTopic (stream1, 'topic' , UserTopicVisibilityPolicy .muted);
364+ await store.setUserTopic (stream1, 'topic' , UserTopicVisibilityPolicy .unmuted);
365365 compareTopicVisibility (store, [
366366 eg.userTopicItem (stream1, 'topic' , UserTopicVisibilityPolicy .unmuted),
367367 ]);
368368 });
369369
370370 test ('remove, with others in stream' , () async {
371371 final store = eg.store ();
372- await store.addUserTopic (stream1, 'topic' , UserTopicVisibilityPolicy .muted);
373- await store.addUserTopic (stream1, 'other topic' , UserTopicVisibilityPolicy .unmuted);
374- await store.addUserTopic (stream1, 'topic' , UserTopicVisibilityPolicy .none);
372+ await store.setUserTopic (stream1, 'topic' , UserTopicVisibilityPolicy .muted);
373+ await store.setUserTopic (stream1, 'other topic' , UserTopicVisibilityPolicy .unmuted);
374+ await store.setUserTopic (stream1, 'topic' , UserTopicVisibilityPolicy .none);
375375 compareTopicVisibility (store, [
376376 eg.userTopicItem (stream1, 'other topic' , UserTopicVisibilityPolicy .unmuted),
377377 ]);
378378 });
379379
380380 test ('remove, as last in stream' , () async {
381381 final store = eg.store ();
382- await store.addUserTopic (stream1, 'topic' , UserTopicVisibilityPolicy .muted);
383- await store.addUserTopic (stream1, 'topic' , UserTopicVisibilityPolicy .none);
382+ await store.setUserTopic (stream1, 'topic' , UserTopicVisibilityPolicy .muted);
383+ await store.setUserTopic (stream1, 'topic' , UserTopicVisibilityPolicy .none);
384384 compareTopicVisibility (store, [
385385 ]);
386386 });
387387
388388 test ('treat unknown enum value as removing' , () async {
389389 final store = eg.store ();
390- await store.addUserTopic (stream1, 'topic' , UserTopicVisibilityPolicy .muted);
391- await store.addUserTopic (stream1, 'topic' , UserTopicVisibilityPolicy .unknown);
390+ await store.setUserTopic (stream1, 'topic' , UserTopicVisibilityPolicy .muted);
391+ await store.setUserTopic (stream1, 'topic' , UserTopicVisibilityPolicy .unknown);
392392 compareTopicVisibility (store, [
393393 ]);
394394 });
0 commit comments