@@ -352,180 +352,6 @@ describe("Heading component", () => {
352352 } ) ;
353353 } ) ;
354354
355- describe ( "linkedcat" , ( ) => {
356- const setupLinkedcat = ( overrideStore ) => {
357- const { storeObject } = setup ( ) ;
358- storeObject . heading . titleStyle = "linkedcat" ;
359- storeObject . query . text = "Some query" ;
360-
361- Object . assign ( storeObject , overrideStore ) ;
362-
363- const store = mockStore ( storeObject ) ;
364-
365- return { store, storeObject } ;
366- } ;
367-
368- it ( "renders with correct streamgraph author label" , ( ) => {
369- const LABEL = "Special Streamgraph Author Test Label" ;
370-
371- const { storeObject } = setupLinkedcat ( ) ;
372- storeObject . heading . titleLabelType = "authorview-streamgraph" ;
373- storeObject . localization . streamgraph_authors_label = LABEL ;
374-
375- const store = mockStore ( storeObject ) ;
376-
377- act ( ( ) => {
378- render (
379- < Provider store = { store } >
380- < Heading />
381- </ Provider > ,
382- container
383- ) ;
384- } ) ;
385-
386- expect ( container . querySelector ( "h4" ) . textContent ) . toContain ( LABEL ) ;
387- } ) ;
388-
389- it ( "renders with correct knowledgemap author label" , ( ) => {
390- const LABEL = "Special Knowledgemap Author Test Label" ;
391-
392- const { storeObject } = setupLinkedcat ( ) ;
393- storeObject . heading . titleLabelType = "authorview-knowledgemap" ;
394- storeObject . localization . overview_authors_label = LABEL ;
395-
396- const store = mockStore ( storeObject ) ;
397-
398- act ( ( ) => {
399- render (
400- < Provider store = { store } >
401- < Heading />
402- </ Provider > ,
403- container
404- ) ;
405- } ) ;
406-
407- expect ( container . querySelector ( "h4" ) . textContent ) . toContain ( LABEL ) ;
408- } ) ;
409-
410- it ( "renders with correct streamgraph non-author label" , ( ) => {
411- const LABEL = "Special Streamgraph non-Author Test Label" ;
412-
413- const { storeObject } = setupLinkedcat ( ) ;
414- storeObject . heading . titleLabelType = "keywordview-streamgraph" ;
415- storeObject . localization . streamgraph_label = LABEL ;
416-
417- const store = mockStore ( storeObject ) ;
418-
419- act ( ( ) => {
420- render (
421- < Provider store = { store } >
422- < Heading />
423- </ Provider > ,
424- container
425- ) ;
426- } ) ;
427-
428- expect ( container . querySelector ( "h4" ) . textContent ) . toContain ( LABEL ) ;
429- } ) ;
430-
431- it ( "renders with correct knowledgemap non-author label" , ( ) => {
432- const LABEL = "Special Knowledgemap non-Author Test Label" ;
433-
434- const { storeObject } = setupLinkedcat ( ) ;
435- storeObject . heading . titleLabelType = "keywordview-knowledgemap" ;
436- storeObject . localization . overview_label = LABEL ;
437-
438- const store = mockStore ( storeObject ) ;
439-
440- act ( ( ) => {
441- render (
442- < Provider store = { store } >
443- < Heading />
444- </ Provider > ,
445- container
446- ) ;
447- } ) ;
448-
449- expect ( container . querySelector ( "h4" ) . textContent ) . toContain ( LABEL ) ;
450- } ) ;
451-
452- it ( "renders with correct query" , ( ) => {
453- const QUERY = "Special Test Query" ;
454-
455- const { store } = setupLinkedcat ( { query : { text : QUERY } } ) ;
456-
457- act ( ( ) => {
458- render (
459- < Provider store = { store } >
460- < Heading />
461- </ Provider > ,
462- container
463- ) ;
464- } ) ;
465-
466- expect (
467- container . querySelector ( "#search-term-unique" ) . textContent
468- ) . toEqual ( QUERY ) ;
469- } ) ;
470-
471- it ( "renders with correct title attribute" , ( ) => {
472- const QUERY = "Special Test Query" ;
473-
474- const { store } = setupLinkedcat ( { query : { text : QUERY } } ) ;
475-
476- act ( ( ) => {
477- render (
478- < Provider store = { store } >
479- < Heading />
480- </ Provider > ,
481- container
482- ) ;
483- } ) ;
484-
485- expect (
486- container . querySelector ( "#search-term-unique" ) . getAttribute ( "title" )
487- ) . toEqual ( QUERY ) ;
488- } ) ;
489-
490- it ( "renders with correct but long title" , ( ) => {
491- const QUERY = "Special Test Query" . repeat ( 100 ) ;
492-
493- const { store } = setupLinkedcat ( { query : { text : QUERY } } ) ;
494-
495- act ( ( ) => {
496- render (
497- < Provider store = { store } >
498- < Heading />
499- </ Provider > ,
500- container
501- ) ;
502- } ) ;
503-
504- expect (
505- container . querySelector ( "#search-term-unique" ) . textContent
506- ) . toContain ( "..." ) ;
507- } ) ;
508-
509- it ( "renders with correct but long title attribute" , ( ) => {
510- const QUERY = "Special Test Query" . repeat ( 100 ) ;
511-
512- const { store } = setupLinkedcat ( { query : { text : QUERY } } ) ;
513-
514- act ( ( ) => {
515- render (
516- < Provider store = { store } >
517- < Heading />
518- </ Provider > ,
519- container
520- ) ;
521- } ) ;
522-
523- expect (
524- container . querySelector ( "#search-term-unique" ) . getAttribute ( "title" )
525- ) . toEqual ( QUERY ) ;
526- } ) ;
527- } ) ;
528-
529355 describe ( "custom title" , ( ) => {
530356 const setupCustom = ( overrideStore ) => {
531357 const { storeObject } = setup ( ) ;
0 commit comments