@@ -11,7 +11,6 @@ const { getGripLengthBubbleText } = require("./test-helpers");
1111const renderRep = ( string , props ) => mount (
1212 Rep ( {
1313 object : string ,
14- omitLinkHref : false ,
1514 ...props ,
1615 } )
1716) ;
@@ -23,7 +22,7 @@ describe("test String with URL", () => {
2322 const element = renderRep ( url , { openLink, useQuotes : false } ) ;
2423 expect ( element . text ( ) ) . toEqual ( url ) ;
2524 const link = element . find ( "a" ) ;
26- expect ( link . prop ( "href" ) ) . toBe ( url ) ;
25+ expect ( link . prop ( "href" ) ) . toBe ( undefined ) ;
2726 expect ( link . prop ( "title" ) ) . toBe ( url ) ;
2827
2928 link . simulate ( "click" ) ;
@@ -50,7 +49,7 @@ describe("test String with URL", () => {
5049 const element = renderRep ( string , { openLink, useQuotes : false } ) ;
5150 expect ( element . text ( ) ) . toEqual ( string ) ;
5251 const link = element . find ( "a" ) ;
53- expect ( link . prop ( "href" ) ) . toBe ( url ) ;
52+ expect ( link . prop ( "href" ) ) . toBe ( undefined ) ;
5453 expect ( link . prop ( "title" ) ) . toBe ( url ) ;
5554
5655 link . simulate ( "click" ) ;
@@ -64,7 +63,7 @@ describe("test String with URL", () => {
6463 const element = renderRep ( string , { openLink, useQuotes : false } ) ;
6564 expect ( element . text ( ) ) . toEqual ( string ) ;
6665 const link = element . find ( "a" ) ;
67- expect ( link . prop ( "href" ) ) . toBe ( url ) ;
66+ expect ( link . prop ( "href" ) ) . toBe ( undefined ) ;
6867 expect ( link . prop ( "title" ) ) . toBe ( url ) ;
6968
7069 link . simulate ( "click" ) ;
@@ -78,7 +77,7 @@ describe("test String with URL", () => {
7877 const element = renderRep ( string , { openLink, useQuotes : true } ) ;
7978 expect ( element . text ( ) ) . toEqual ( `"\\"${ url } \\""` ) ;
8079 const link = element . find ( "a" ) ;
81- expect ( link . prop ( "href" ) ) . toBe ( url ) ;
80+ expect ( link . prop ( "href" ) ) . toBe ( undefined ) ;
8281 expect ( link . prop ( "title" ) ) . toBe ( url ) ;
8382
8483 link . simulate ( "click" ) ;
@@ -91,7 +90,7 @@ describe("test String with URL", () => {
9190 const element = renderRep ( url , { openLink, useQuotes : false } ) ;
9291 expect ( element . text ( ) ) . toEqual ( url ) ;
9392 const link = element . find ( "a" ) ;
94- expect ( link . prop ( "href" ) ) . toBe ( url ) ;
93+ expect ( link . prop ( "href" ) ) . toBe ( undefined ) ;
9594 expect ( link . prop ( "title" ) ) . toBe ( url ) ;
9695
9796 link . simulate ( "click" ) ;
@@ -104,7 +103,7 @@ describe("test String with URL", () => {
104103 const element = renderRep ( url , { openLink, useQuotes : false } ) ;
105104 expect ( element . text ( ) ) . toEqual ( url ) ;
106105 const link = element . find ( "a" ) ;
107- expect ( link . prop ( "href" ) ) . toBe ( url ) ;
106+ expect ( link . prop ( "href" ) ) . toBe ( undefined ) ;
108107 expect ( link . prop ( "title" ) ) . toBe ( url ) ;
109108
110109 link . simulate ( "click" ) ;
@@ -117,7 +116,7 @@ describe("test String with URL", () => {
117116 const element = renderRep ( url , { openLink, useQuotes : false } ) ;
118117 expect ( element . text ( ) ) . toEqual ( url ) ;
119118 const link = element . find ( "a" ) ;
120- expect ( link . prop ( "href" ) ) . toBe ( url ) ;
119+ expect ( link . prop ( "href" ) ) . toBe ( undefined ) ;
121120 expect ( link . prop ( "title" ) ) . toBe ( url ) ;
122121
123122 link . simulate ( "click" ) ;
@@ -131,7 +130,7 @@ describe("test String with URL", () => {
131130 const element = renderRep ( string , { openLink, useQuotes : false } ) ;
132131 expect ( element . text ( ) ) . toEqual ( string ) ;
133132 const link = element . find ( "a" ) ;
134- expect ( link . prop ( "href" ) ) . toBe ( url ) ;
133+ expect ( link . prop ( "href" ) ) . toBe ( undefined ) ;
135134 expect ( link . prop ( "title" ) ) . toBe ( url ) ;
136135
137136 link . simulate ( "click" ) ;
@@ -146,7 +145,7 @@ describe("test String with URL", () => {
146145 expect ( element . text ( ) ) . toEqual ( string ) ;
147146
148147 const link = element . find ( "a" ) ;
149- expect ( link . prop ( "href" ) ) . toBe ( url ) ;
148+ expect ( link . prop ( "href" ) ) . toBe ( undefined ) ;
150149 expect ( link . prop ( "title" ) ) . toBe ( url ) ;
151150
152151 link . simulate ( "click" ) ;
@@ -164,13 +163,13 @@ describe("test String with URL", () => {
164163 expect ( links . length ) . toBe ( 2 ) ;
165164
166165 const firstLink = links . at ( 0 ) ;
167- expect ( firstLink . prop ( "href" ) ) . toBe ( url1 ) ;
166+ expect ( firstLink . prop ( "href" ) ) . toBe ( undefined ) ;
168167 expect ( firstLink . prop ( "title" ) ) . toBe ( url1 ) ;
169168 firstLink . simulate ( "click" ) ;
170169 expect ( openLink ) . toBeCalledWith ( url1 ) ;
171170
172171 const secondLink = links . at ( 1 ) ;
173- expect ( secondLink . prop ( "href" ) ) . toBe ( url2 ) ;
172+ expect ( secondLink . prop ( "href" ) ) . toBe ( undefined ) ;
174173 expect ( secondLink . prop ( "title" ) ) . toBe ( url2 ) ;
175174 secondLink . simulate ( "click" ) ;
176175 expect ( openLink ) . toBeCalledWith ( url2 ) ;
@@ -197,7 +196,7 @@ describe("test String with URL", () => {
197196
198197 expect ( element . text ( ) ) . toEqual ( "http://…ple.com" ) ;
199198 const link = element . find ( "a" ) ;
200- expect ( link . prop ( "href" ) ) . toBe ( url ) ;
199+ expect ( link . prop ( "href" ) ) . toBe ( undefined ) ;
201200 expect ( link . prop ( "title" ) ) . toBe ( url ) ;
202201
203202 link . simulate ( "click" ) ;
@@ -215,7 +214,7 @@ describe("test String with URL", () => {
215214
216215 expect ( element . text ( ) ) . toEqual ( url ) ;
217216 const link = element . find ( "a" ) ;
218- expect ( link . prop ( "href" ) ) . toBe ( url ) ;
217+ expect ( link . prop ( "href" ) ) . toBe ( undefined ) ;
219218 expect ( link . prop ( "title" ) ) . toBe ( url ) ;
220219
221220 link . simulate ( "click" ) ;
@@ -235,7 +234,7 @@ describe("test String with URL", () => {
235234
236235 expect ( element . text ( ) ) . toEqual ( url ) ;
237236 const link = element . find ( "a" ) ;
238- expect ( link . prop ( "href" ) ) . toBe ( url ) ;
237+ expect ( link . prop ( "href" ) ) . toBe ( undefined ) ;
239238 expect ( link . prop ( "title" ) ) . toBe ( url ) ;
240239
241240 link . simulate ( "click" ) ;
@@ -253,11 +252,11 @@ describe("test String with URL", () => {
253252
254253 expect ( element . text ( ) ) . toEqual ( "- http://example.fr … http://example.us -" ) ;
255254 const linkFr = element . find ( "a" ) . at ( 0 ) ;
256- expect ( linkFr . prop ( "href" ) ) . toBe ( "http://example.fr" ) ;
255+ expect ( linkFr . prop ( "href" ) ) . toBe ( undefined ) ;
257256 expect ( linkFr . prop ( "title" ) ) . toBe ( "http://example.fr" ) ;
258257
259258 const linkUs = element . find ( "a" ) . at ( 1 ) ;
260- expect ( linkUs . prop ( "href" ) ) . toBe ( "http://example.us" ) ;
259+ expect ( linkUs . prop ( "href" ) ) . toBe ( undefined ) ;
261260 expect ( linkUs . prop ( "title" ) ) . toBe ( "http://example.us" ) ;
262261 } ) ;
263262
@@ -272,11 +271,11 @@ describe("test String with URL", () => {
272271
273272 expect ( element . text ( ) ) . toEqual ( "- http://example.fr -…- http://example.us -" ) ;
274273 const linkFr = element . find ( "a" ) . at ( 0 ) ;
275- expect ( linkFr . prop ( "href" ) ) . toBe ( "http://example.fr" ) ;
274+ expect ( linkFr . prop ( "href" ) ) . toBe ( undefined ) ;
276275 expect ( linkFr . prop ( "title" ) ) . toBe ( "http://example.fr" ) ;
277276
278277 const linkUs = element . find ( "a" ) . at ( 1 ) ;
279- expect ( linkUs . prop ( "href" ) ) . toBe ( "http://example.us" ) ;
278+ expect ( linkUs . prop ( "href" ) ) . toBe ( undefined ) ;
280279 expect ( linkUs . prop ( "title" ) ) . toBe ( "http://example.us" ) ;
281280 } ) ;
282281
@@ -291,11 +290,11 @@ describe("test String with URL", () => {
291290
292291 expect ( element . text ( ) ) . toEqual ( "- http://e…ample.us -" ) ;
293292 const linkFr = element . find ( "a" ) . at ( 0 ) ;
294- expect ( linkFr . prop ( "href" ) ) . toBe ( "http://example-long.fr" ) ;
293+ expect ( linkFr . prop ( "href" ) ) . toBe ( undefined ) ;
295294 expect ( linkFr . prop ( "title" ) ) . toBe ( "http://example-long.fr" ) ;
296295
297296 const linkUs = element . find ( "a" ) . at ( 1 ) ;
298- expect ( linkUs . prop ( "href" ) ) . toBe ( "http://example.us" ) ;
297+ expect ( linkUs . prop ( "href" ) ) . toBe ( undefined ) ;
299298 expect ( linkUs . prop ( "title" ) ) . toBe ( "http://example.us" ) ;
300299 } ) ;
301300
@@ -310,15 +309,15 @@ describe("test String with URL", () => {
310309
311310 expect ( element . text ( ) ) . toEqual ( "- http://example-long.fr http:…xample.com http://example.us -" ) ;
312311 const linkFr = element . find ( "a" ) . at ( 0 ) ;
313- expect ( linkFr . prop ( "href" ) ) . toBe ( "http://example-long.fr" ) ;
312+ expect ( linkFr . prop ( "href" ) ) . toBe ( undefined ) ;
314313 expect ( linkFr . prop ( "title" ) ) . toBe ( "http://example-long.fr" ) ;
315314
316315 const linkCom = element . find ( "a" ) . at ( 1 ) ;
317- expect ( linkCom . prop ( "href" ) ) . toBe ( "http://example.com" ) ;
316+ expect ( linkCom . prop ( "href" ) ) . toBe ( undefined ) ;
318317 expect ( linkCom . prop ( "title" ) ) . toBe ( "http://example.com" ) ;
319318
320319 const linkUs = element . find ( "a" ) . at ( 2 ) ;
321- expect ( linkUs . prop ( "href" ) ) . toBe ( "http://example.us" ) ;
320+ expect ( linkUs . prop ( "href" ) ) . toBe ( undefined ) ;
322321 expect ( linkUs . prop ( "title" ) ) . toBe ( "http://example.us" ) ;
323322 } ) ;
324323
@@ -333,11 +332,11 @@ describe("test String with URL", () => {
333332
334333 expect ( element . text ( ) ) . toEqual ( "- http://e…ample.us -" ) ;
335334 const linkFr = element . find ( "a" ) . at ( 0 ) ;
336- expect ( linkFr . prop ( "href" ) ) . toBe ( "http://example.fr" ) ;
335+ expect ( linkFr . prop ( "href" ) ) . toBe ( undefined ) ;
337336 expect ( linkFr . prop ( "title" ) ) . toBe ( "http://example.fr" ) ;
338337
339338 const linkUs = element . find ( "a" ) . at ( 1 ) ;
340- expect ( linkUs . prop ( "href" ) ) . toBe ( "http://example.us" ) ;
339+ expect ( linkUs . prop ( "href" ) ) . toBe ( undefined ) ;
341340 expect ( linkUs . prop ( "title" ) ) . toBe ( "http://example.us" ) ;
342341 } ) ;
343342
@@ -352,7 +351,7 @@ describe("test String with URL", () => {
352351
353352 expect ( element . text ( ) ) . toEqual ( "http://exa…cdefghijkl" ) ;
354353 const linkFr = element . find ( "a" ) . at ( 0 ) ;
355- expect ( linkFr . prop ( "href" ) ) . toBe ( "http://example.fr" ) ;
354+ expect ( linkFr . prop ( "href" ) ) . toBe ( undefined ) ;
356355 expect ( linkFr . prop ( "title" ) ) . toBe ( "http://example.fr" ) ;
357356 } ) ;
358357
@@ -367,7 +366,7 @@ describe("test String with URL", () => {
367366
368367 expect ( element . text ( ) ) . toEqual ( "abcdefghij…xample.fr " ) ;
369368 const linkFr = element . find ( "a" ) . at ( 0 ) ;
370- expect ( linkFr . prop ( "href" ) ) . toBe ( "http://example.fr" ) ;
369+ expect ( linkFr . prop ( "href" ) ) . toBe ( undefined ) ;
371370 expect ( linkFr . prop ( "title" ) ) . toBe ( "http://example.fr" ) ;
372371 } ) ;
373372
@@ -394,7 +393,7 @@ describe("test String with URL", () => {
394393 expect ( element . text ( ) ) . toEqual ( `[ "${ string } " ]` ) ;
395394
396395 const link = element . find ( "a" ) ;
397- expect ( link . prop ( "href" ) ) . toBe ( url ) ;
396+ expect ( link . prop ( "href" ) ) . toBe ( undefined ) ;
398397 expect ( link . prop ( "title" ) ) . toBe ( url ) ;
399398
400399 link . simulate ( "click" ) ;
@@ -413,7 +412,7 @@ describe("test String with URL", () => {
413412 expect ( element . text ( ) ) . toEqual ( `Array${ length } [ "${ string } " ]` ) ;
414413
415414 const link = element . find ( "a" ) ;
416- expect ( link . prop ( "href" ) ) . toBe ( url ) ;
415+ expect ( link . prop ( "href" ) ) . toBe ( undefined ) ;
417416 expect ( link . prop ( "title" ) ) . toBe ( url ) ;
418417
419418 link . simulate ( "click" ) ;
@@ -429,7 +428,7 @@ describe("test String with URL", () => {
429428 expect ( element . text ( ) ) . toEqual ( `Object { test: "${ string } " }` ) ;
430429
431430 const link = element . find ( "a" ) ;
432- expect ( link . prop ( "href" ) ) . toBe ( url ) ;
431+ expect ( link . prop ( "href" ) ) . toBe ( undefined ) ;
433432 expect ( link . prop ( "title" ) ) . toBe ( url ) ;
434433
435434 link . simulate ( "click" ) ;
@@ -447,26 +446,10 @@ describe("test String with URL", () => {
447446 expect ( element . text ( ) ) . toEqual ( `Object { test: "${ string } " }` ) ;
448447
449448 const link = element . find ( "a" ) ;
450- expect ( link . prop ( "href" ) ) . toBe ( url ) ;
449+ expect ( link . prop ( "href" ) ) . toBe ( undefined ) ;
451450 expect ( link . prop ( "title" ) ) . toBe ( url ) ;
452451
453452 link . simulate ( "click" ) ;
454453 expect ( openLink ) . toBeCalledWith ( url ) ;
455454 } ) ;
456-
457- it ( "does not create an href attribute if omitLinkHref is true" , ( ) => {
458- const url = "http://example.com" ;
459- const element = renderRep ( url , { omitLinkHref : true , useQuotes : false } ) ;
460- expect ( element . text ( ) ) . toEqual ( url ) ;
461- const link = element . find ( "a" ) ;
462- expect ( link . prop ( "href" ) ) . toBe ( null ) ;
463- } ) ;
464-
465- it ( "does not create an href attribute if omitLinkHref is undefined" , ( ) => {
466- const url = "http://example.com" ;
467- const element = mount ( Rep ( { object : url , useQuotes : false } ) ) ;
468- expect ( element . text ( ) ) . toEqual ( url ) ;
469- const link = element . find ( "a" ) ;
470- expect ( link . prop ( "href" ) ) . toBe ( null ) ;
471- } ) ;
472455} ) ;
0 commit comments