Skip to content

Commit adac805

Browse files
chrisbobbegnprice
authored andcommitted
internalLinks tests [nfc]: Name some tests more accurately
The expectations aren't really about what the link *contains* -- we shouldn't treat a PM link as a topic link just because someone's name has "topic" in it, for example. It's about the structure of the link; name the tests accordingly.
1 parent e0db8a2 commit adac805

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/utils/__tests__/internalLinks-test.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ describe('getNarrowFromNarrowLink (part 1)', () => {
160160
}
161161
};
162162

163-
describe('link containing "stream" is a stream link', () => {
163+
describe('"/#narrow/stream/<…>" is a stream link', () => {
164164
const check = mkCheck(isStreamNarrow);
165165
['/#narrow/stream/jest', '/#narrow/stream/stream/', '/#narrow/stream/topic/'].forEach(hash =>
166166
check(hash),
@@ -169,7 +169,7 @@ describe('getNarrowFromNarrowLink (part 1)', () => {
169169
// TODO: Test with modern-style stream links that use stream IDs
170170
});
171171

172-
describe('link containing "topic" is a topic link', () => {
172+
describe('"/#narrow/stream/<…>/topic/<…>" is a topic link', () => {
173173
const check = mkCheck(isTopicNarrow);
174174
[
175175
'/#narrow/stream/jest/topic/test',
@@ -181,7 +181,7 @@ describe('getNarrowFromNarrowLink (part 1)', () => {
181181
].forEach(hash => check(hash));
182182
});
183183

184-
describe('link containing "pm-with" is a PM link', () => {
184+
describe('"/#narrow/pm-with/<…>" is a PM link', () => {
185185
const check = mkCheck(isPmNarrow);
186186
[
187187
'/#narrow/pm-with/1,2-group',
@@ -190,7 +190,7 @@ describe('getNarrowFromNarrowLink (part 1)', () => {
190190
].forEach(hash => check(hash));
191191
});
192192

193-
describe('link containing "is" with valid operand is a special link', () => {
193+
describe('"/#narrow/is/<…>" with valid operand is a special link', () => {
194194
const check = mkCheck(isSpecialNarrow);
195195
['/#narrow/is/private', '/#narrow/is/starred', '/#narrow/is/mentioned'].forEach(hash =>
196196
check(hash),

0 commit comments

Comments
 (0)