@@ -123,14 +123,14 @@ void main() {
123
123
group ('getter topicVisibilityPolicy' , () {
124
124
test ('with nothing for stream' , () {
125
125
final store = eg.store ();
126
- check (store.topicVisibilityPolicy (stream1.streamId, 'topic' ))
126
+ check (store.topicVisibilityPolicy (stream1.streamId, eg. t ( 'topic' ) ))
127
127
.equals (UserTopicVisibilityPolicy .none);
128
128
});
129
129
130
130
test ('with nothing for topic' , () async {
131
131
final store = eg.store ();
132
132
await store.addUserTopic (stream1, 'other topic' , UserTopicVisibilityPolicy .muted);
133
- check (store.topicVisibilityPolicy (stream1.streamId, 'topic' ))
133
+ check (store.topicVisibilityPolicy (stream1.streamId, eg. t ( 'topic' ) ))
134
134
.equals (UserTopicVisibilityPolicy .none);
135
135
});
136
136
@@ -142,7 +142,7 @@ void main() {
142
142
UserTopicVisibilityPolicy .followed,
143
143
]) {
144
144
await store.addUserTopic (stream1, 'topic' , policy);
145
- check (store.topicVisibilityPolicy (stream1.streamId, 'topic' ))
145
+ check (store.topicVisibilityPolicy (stream1.streamId, eg. t ( 'topic' ) ))
146
146
.equals (policy);
147
147
}
148
148
});
@@ -153,50 +153,50 @@ void main() {
153
153
final store = eg.store ();
154
154
await store.addStream (stream1);
155
155
await store.addSubscription (eg.subscription (stream1));
156
- check (store.isTopicVisibleInStream (stream1.streamId, 'topic' )).isTrue ();
157
- check (store.isTopicVisible (stream1.streamId, 'topic' )).isTrue ();
156
+ check (store.isTopicVisibleInStream (stream1.streamId, eg. t ( 'topic' ) )).isTrue ();
157
+ check (store.isTopicVisible (stream1.streamId, eg. t ( 'topic' ) )).isTrue ();
158
158
});
159
159
160
160
test ('with policy none, stream muted' , () async {
161
161
final store = eg.store ();
162
162
await store.addStream (stream1);
163
163
await store.addSubscription (eg.subscription (stream1, isMuted: true ));
164
- check (store.isTopicVisibleInStream (stream1.streamId, 'topic' )).isTrue ();
165
- check (store.isTopicVisible (stream1.streamId, 'topic' )).isFalse ();
164
+ check (store.isTopicVisibleInStream (stream1.streamId, eg. t ( 'topic' ) )).isTrue ();
165
+ check (store.isTopicVisible (stream1.streamId, eg. t ( 'topic' ) )).isFalse ();
166
166
});
167
167
168
168
test ('with policy none, stream unsubscribed' , () async {
169
169
final store = eg.store ();
170
170
await store.addStream (stream1);
171
- check (store.isTopicVisibleInStream (stream1.streamId, 'topic' )).isTrue ();
172
- check (store.isTopicVisible (stream1.streamId, 'topic' )).isFalse ();
171
+ check (store.isTopicVisibleInStream (stream1.streamId, eg. t ( 'topic' ) )).isTrue ();
172
+ check (store.isTopicVisible (stream1.streamId, eg. t ( 'topic' ) )).isFalse ();
173
173
});
174
174
175
175
test ('with policy muted' , () async {
176
176
final store = eg.store ();
177
177
await store.addStream (stream1);
178
178
await store.addSubscription (eg.subscription (stream1));
179
179
await store.addUserTopic (stream1, 'topic' , UserTopicVisibilityPolicy .muted);
180
- check (store.isTopicVisibleInStream (stream1.streamId, 'topic' )).isFalse ();
181
- check (store.isTopicVisible (stream1.streamId, 'topic' )).isFalse ();
180
+ check (store.isTopicVisibleInStream (stream1.streamId, eg. t ( 'topic' ) )).isFalse ();
181
+ check (store.isTopicVisible (stream1.streamId, eg. t ( 'topic' ) )).isFalse ();
182
182
});
183
183
184
184
test ('with policy unmuted' , () async {
185
185
final store = eg.store ();
186
186
await store.addStream (stream1);
187
187
await store.addSubscription (eg.subscription (stream1, isMuted: true ));
188
188
await store.addUserTopic (stream1, 'topic' , UserTopicVisibilityPolicy .unmuted);
189
- check (store.isTopicVisibleInStream (stream1.streamId, 'topic' )).isTrue ();
190
- check (store.isTopicVisible (stream1.streamId, 'topic' )).isTrue ();
189
+ check (store.isTopicVisibleInStream (stream1.streamId, eg. t ( 'topic' ) )).isTrue ();
190
+ check (store.isTopicVisible (stream1.streamId, eg. t ( 'topic' ) )).isTrue ();
191
191
});
192
192
193
193
test ('with policy followed' , () async {
194
194
final store = eg.store ();
195
195
await store.addStream (stream1);
196
196
await store.addSubscription (eg.subscription (stream1, isMuted: true ));
197
197
await store.addUserTopic (stream1, 'topic' , UserTopicVisibilityPolicy .followed);
198
- check (store.isTopicVisibleInStream (stream1.streamId, 'topic' )).isTrue ();
199
- check (store.isTopicVisible (stream1.streamId, 'topic' )).isTrue ();
198
+ check (store.isTopicVisibleInStream (stream1.streamId, eg. t ( 'topic' ) )).isTrue ();
199
+ check (store.isTopicVisible (stream1.streamId, eg. t ( 'topic' ) )).isTrue ();
200
200
});
201
201
});
202
202
@@ -265,16 +265,16 @@ void main() {
265
265
eg.subscription (stream1, isMuted: streamMuted));
266
266
}
267
267
await store.handleEvent (mkEvent (oldPolicy));
268
- final oldVisibleInStream = store.isTopicVisibleInStream (stream1.streamId, 'topic' );
269
- final oldVisible = store.isTopicVisible (stream1.streamId, 'topic' );
268
+ final oldVisibleInStream = store.isTopicVisibleInStream (stream1.streamId, eg. t ( 'topic' ) );
269
+ final oldVisible = store.isTopicVisible (stream1.streamId, eg. t ( 'topic' ) );
270
270
271
271
final event = mkEvent (newPolicy);
272
272
final willChangeInStream = store.willChangeIfTopicVisibleInStream (event);
273
273
final willChange = store.willChangeIfTopicVisible (event);
274
274
275
275
await store.handleEvent (event);
276
- final newVisibleInStream = store.isTopicVisibleInStream (stream1.streamId, 'topic' );
277
- final newVisible = store.isTopicVisible (stream1.streamId, 'topic' );
276
+ final newVisibleInStream = store.isTopicVisibleInStream (stream1.streamId, eg. t ( 'topic' ) );
277
+ final newVisible = store.isTopicVisible (stream1.streamId, eg. t ( 'topic' ) );
278
278
279
279
VisibilityEffect fromOldNew (bool oldVisible, bool newVisible) {
280
280
if (newVisible == oldVisible) return VisibilityEffect .none;
@@ -384,13 +384,13 @@ void main() {
384
384
eg.userTopicItem (stream, 'topic 2' , UserTopicVisibilityPolicy .unmuted),
385
385
eg.userTopicItem (stream, 'topic 3' , UserTopicVisibilityPolicy .followed),
386
386
]));
387
- check (store.topicVisibilityPolicy (stream.streamId, 'topic 1' ))
387
+ check (store.topicVisibilityPolicy (stream.streamId, eg. t ( 'topic 1' ) ))
388
388
.equals (UserTopicVisibilityPolicy .muted);
389
- check (store.topicVisibilityPolicy (stream.streamId, 'topic 2' ))
389
+ check (store.topicVisibilityPolicy (stream.streamId, eg. t ( 'topic 2' ) ))
390
390
.equals (UserTopicVisibilityPolicy .unmuted);
391
- check (store.topicVisibilityPolicy (stream.streamId, 'topic 3' ))
391
+ check (store.topicVisibilityPolicy (stream.streamId, eg. t ( 'topic 3' ) ))
392
392
.equals (UserTopicVisibilityPolicy .followed);
393
- check (store.topicVisibilityPolicy (stream.streamId, 'topic 4' ))
393
+ check (store.topicVisibilityPolicy (stream.streamId, eg. t ( 'topic 4' ) ))
394
394
.equals (UserTopicVisibilityPolicy .none);
395
395
});
396
396
});
0 commit comments