@@ -123,17 +123,19 @@ describe('isNarrowLink', () => {
123
123
124
124
describe ( 'getLinkType' , ( ) => {
125
125
const mkCheck = ( expected : LinkType ) => hash => {
126
- expect ( getLinkType ( new URL ( hash , realm ) , realm ) ) . toBe ( expected ) ;
126
+ test ( `${ hash } - should return ${ expected } ` , ( ) => {
127
+ expect ( getLinkType ( new URL ( hash , realm ) , realm ) ) . toBe ( expected ) ;
128
+ } ) ;
127
129
} ;
128
130
129
- test ( 'link containing "stream" is a stream link' , ( ) => {
131
+ describe ( 'link containing "stream" is a stream link' , ( ) => {
130
132
const check = mkCheck ( 'stream' ) ;
131
133
[ '/#narrow/stream/jest' , '/#narrow/stream/stream/' , '/#narrow/stream/topic/' ] . forEach ( hash =>
132
134
check ( hash ) ,
133
135
) ;
134
136
} ) ;
135
137
136
- test ( 'link containing "topic" is a topic link' , ( ) => {
138
+ describe ( 'link containing "topic" is a topic link' , ( ) => {
137
139
const check = mkCheck ( 'topic' ) ;
138
140
[
139
141
'/#narrow/stream/jest/topic/test' ,
@@ -145,7 +147,7 @@ describe('getLinkType', () => {
145
147
] . forEach ( hash => check ( hash ) ) ;
146
148
} ) ;
147
149
148
- test ( 'link containing "pm-with" is a PM link' , ( ) => {
150
+ describe ( 'link containing "pm-with" is a PM link' , ( ) => {
149
151
const check = mkCheck ( 'pm' ) ;
150
152
[
151
153
'/#narrow/pm-with/1,2-group' ,
@@ -154,14 +156,14 @@ describe('getLinkType', () => {
154
156
] . forEach ( hash => check ( hash ) ) ;
155
157
} ) ;
156
158
157
- test ( 'link containing "is" with valid operand is a special link' , ( ) => {
159
+ describe ( 'link containing "is" with valid operand is a special link' , ( ) => {
158
160
const check = mkCheck ( 'special' ) ;
159
161
[ '/#narrow/is/private' , '/#narrow/is/starred' , '/#narrow/is/mentioned' ] . forEach ( hash =>
160
162
check ( hash ) ,
161
163
) ;
162
164
} ) ;
163
165
164
- test ( 'unexpected link shape gives "home"' , ( ) => {
166
+ describe ( 'unexpected link shape gives "home"' , ( ) => {
165
167
const check = mkCheck ( 'home' ) ;
166
168
[
167
169
// `near` with no operand
0 commit comments