@@ -95,7 +95,7 @@ describe('getShownMessagesForNarrow', () => {
95
95
const message = eg . streamMessage ( ) ;
96
96
const subscription = eg . subscription ;
97
97
const mutedSubscription = { ...subscription , in_home_view : false } ;
98
- const mutes = makeMuteState ( [ [ stream , message . subject ] ] ) ;
98
+ const muteTopic = makeMuteState ( [ [ stream , message . subject ] ] ) ;
99
99
100
100
const makeStateGeneral = ( message , narrow , extra ) =>
101
101
eg . reduxStatePlus ( {
@@ -110,31 +110,31 @@ describe('getShownMessagesForNarrow', () => {
110
110
const makeState = extra => makeStateGeneral ( message , narrow , extra ) ;
111
111
const shown = state => shownGeneral ( state , narrow ) ;
112
112
113
- test ( 'private messages are never muted ' , ( ) => {
113
+ test ( 'private message shown ' , ( ) => {
114
114
expect ( shown ( makeStateGeneral ( eg . pmMessage ( ) , narrow ) ) ) . toEqual ( true ) ;
115
115
} ) ;
116
116
117
- test ( 'message in a stream is not muted if stream and topic not muted ' , ( ) => {
117
+ test ( 'stream message shown in base case ' , ( ) => {
118
118
expect ( shown ( makeState ( ) ) ) . toEqual ( true ) ;
119
119
} ) ;
120
120
121
- test ( 'message in a stream is muted if stream is not in subscriptions ' , ( ) => {
121
+ test ( 'stream message hidden if not subscribed to stream ' , ( ) => {
122
122
expect ( shown ( makeState ( { subscriptions : [ ] } ) ) ) . toEqual ( false ) ;
123
123
} ) ;
124
124
125
- test ( 'message in a stream is muted if the stream is muted' , ( ) => {
125
+ test ( 'stream message hidden if stream muted' , ( ) => {
126
126
expect ( shown ( makeState ( { subscriptions : [ mutedSubscription ] } ) ) ) . toEqual ( false ) ;
127
127
} ) ;
128
128
129
- test ( 'message in a stream is muted if the topic is muted and topic matches ' , ( ) => {
130
- expect ( shown ( makeState ( { mute : mutes } ) ) ) . toEqual ( false ) ;
129
+ test ( 'stream message hidden if topic muted' , ( ) => {
130
+ expect ( shown ( makeState ( { mute : muteTopic } ) ) ) . toEqual ( false ) ;
131
131
} ) ;
132
132
133
- test ( '@-mention message is never muted ' , ( ) => {
133
+ test ( '@-mention message is always shown ' , ( ) => {
134
134
const flags = { ...eg . plusReduxState . flags , mentioned : { [ message . id ] : true } } ;
135
135
expect ( shown ( makeState ( { flags, subscriptions : [ ] } ) ) ) . toEqual ( true ) ;
136
136
expect ( shown ( makeState ( { flags, subscriptions : [ mutedSubscription ] } ) ) ) . toEqual ( true ) ;
137
- expect ( shown ( makeState ( { flags, mute : mutes } ) ) ) . toEqual ( true ) ;
137
+ expect ( shown ( makeState ( { flags, mute : muteTopic } ) ) ) . toEqual ( true ) ;
138
138
} ) ;
139
139
} ) ;
140
140
@@ -143,23 +143,23 @@ describe('getShownMessagesForNarrow', () => {
143
143
const makeState = extra => makeStateGeneral ( message , narrow , extra ) ;
144
144
const shown = state => shownGeneral ( state , narrow ) ;
145
145
146
- test ( 'message not muted even if stream not subscribed' , ( ) => {
146
+ test ( 'message shown even if not subscribed to stream ' , ( ) => {
147
147
expect ( shown ( makeState ( { subscriptions : [ ] } ) ) ) . toEqual ( true ) ;
148
148
} ) ;
149
149
150
- test ( 'message not muted even if stream is muted' , ( ) => {
150
+ test ( 'message shown even if stream muted' , ( ) => {
151
151
expect ( shown ( makeState ( { subscriptions : [ mutedSubscription ] } ) ) ) . toEqual ( true ) ;
152
152
} ) ;
153
153
154
- test ( 'message muted if topic is muted' , ( ) => {
155
- expect ( shown ( makeState ( { mute : mutes } ) ) ) . toEqual ( false ) ;
154
+ test ( 'message hidden if topic muted' , ( ) => {
155
+ expect ( shown ( makeState ( { mute : muteTopic } ) ) ) . toEqual ( false ) ;
156
156
} ) ;
157
157
158
- test ( '@-mention message is never muted ' , ( ) => {
158
+ test ( '@-mention message is always shown ' , ( ) => {
159
159
const flags = { ...eg . plusReduxState . flags , mentioned : { [ message . id ] : true } } ;
160
160
expect ( shown ( makeState ( { flags, subscriptions : [ ] } ) ) ) . toEqual ( true ) ;
161
161
expect ( shown ( makeState ( { flags, subscriptions : [ mutedSubscription ] } ) ) ) . toEqual ( true ) ;
162
- expect ( shown ( makeState ( { flags, mute : mutes } ) ) ) . toEqual ( true ) ;
162
+ expect ( shown ( makeState ( { flags, mute : muteTopic } ) ) ) . toEqual ( true ) ;
163
163
} ) ;
164
164
} ) ;
165
165
@@ -168,16 +168,16 @@ describe('getShownMessagesForNarrow', () => {
168
168
const makeState = extra => makeStateGeneral ( message , narrow , extra ) ;
169
169
const shown = state => shownGeneral ( state , narrow ) ;
170
170
171
- test ( 'message not muted even if stream not subscribed' , ( ) => {
171
+ test ( 'message shown even if not subscribed to stream ' , ( ) => {
172
172
expect ( shown ( makeState ( { subscriptions : [ ] } ) ) ) . toEqual ( true ) ;
173
173
} ) ;
174
174
175
- test ( 'message not muted even if stream is muted' , ( ) => {
175
+ test ( 'message shown even if stream muted' , ( ) => {
176
176
expect ( shown ( makeState ( { subscriptions : [ mutedSubscription ] } ) ) ) . toEqual ( true ) ;
177
177
} ) ;
178
178
179
- test ( 'message not muted even if topic is muted' , ( ) => {
180
- expect ( shown ( makeState ( { mute : mutes } ) ) ) . toEqual ( true ) ;
179
+ test ( 'message shown even if topic muted' , ( ) => {
180
+ expect ( shown ( makeState ( { mute : muteTopic } ) ) ) . toEqual ( true ) ;
181
181
} ) ;
182
182
} ) ;
183
183
@@ -186,16 +186,16 @@ describe('getShownMessagesForNarrow', () => {
186
186
const makeState = extra => makeStateGeneral ( message , narrow , extra ) ;
187
187
const shown = state => shownGeneral ( state , narrow ) ;
188
188
189
- test ( 'message not muted even if stream not subscribed' , ( ) => {
189
+ test ( 'message shown even if not subscribed to stream ' , ( ) => {
190
190
expect ( shown ( makeState ( { subscriptions : [ ] } ) ) ) . toEqual ( true ) ;
191
191
} ) ;
192
192
193
- test ( 'message not muted even if stream is muted' , ( ) => {
193
+ test ( 'message shown even if stream muted' , ( ) => {
194
194
expect ( shown ( makeState ( { subscriptions : [ mutedSubscription ] } ) ) ) . toEqual ( true ) ;
195
195
} ) ;
196
196
197
- test ( 'message not muted even if topic is muted' , ( ) => {
198
- expect ( shown ( makeState ( { mute : mutes } ) ) ) . toEqual ( true ) ;
197
+ test ( 'message shown even if topic muted' , ( ) => {
198
+ expect ( shown ( makeState ( { mute : muteTopic } ) ) ) . toEqual ( true ) ;
199
199
} ) ;
200
200
} ) ;
201
201
@@ -204,16 +204,16 @@ describe('getShownMessagesForNarrow', () => {
204
204
const makeState = extra => makeStateGeneral ( message , narrow , extra ) ;
205
205
const shown = state => shownGeneral ( state , narrow ) ;
206
206
207
- test ( 'message not muted even if stream not subscribed' , ( ) => {
207
+ test ( 'message shown even if not subscribed to stream ' , ( ) => {
208
208
expect ( shown ( makeState ( { subscriptions : [ ] } ) ) ) . toEqual ( true ) ;
209
209
} ) ;
210
210
211
- test ( 'message not muted even if stream is muted' , ( ) => {
211
+ test ( 'message shown even if stream muted' , ( ) => {
212
212
expect ( shown ( makeState ( { subscriptions : [ mutedSubscription ] } ) ) ) . toEqual ( true ) ;
213
213
} ) ;
214
214
215
- test ( 'message not muted even if topic is muted' , ( ) => {
216
- expect ( shown ( makeState ( { mute : mutes } ) ) ) . toEqual ( true ) ;
215
+ test ( 'message shown even if topic muted' , ( ) => {
216
+ expect ( shown ( makeState ( { mute : muteTopic } ) ) ) . toEqual ( true ) ;
217
217
} ) ;
218
218
} ) ;
219
219
} ) ;
0 commit comments