@@ -4,7 +4,7 @@ import { fireEvent, render, screen, waitFor } from '@testing-library/react';
44import { ChatbotDisplayMode } from '../Chatbot/Chatbot' ;
55import ChatbotConversationHistoryNav , { Conversation } from './ChatbotConversationHistoryNav' ;
66import { EmptyStateStatus , Spinner } from '@patternfly/react-core' ;
7- import { OutlinedCommentsIcon , SearchIcon } from '@patternfly/react-icons' ;
7+ import { BellIcon , OutlinedCommentsIcon , SearchIcon } from '@patternfly/react-icons' ;
88import { ComponentType } from 'react' ;
99
1010const ERROR = {
@@ -492,29 +492,29 @@ describe('ChatbotConversationHistoryNav', () => {
492492 expect ( iconElement ) . toBeInTheDocument ( ) ;
493493 } ) ;
494494
495- it ( 'Passes titleProps to Title' , ( ) => {
495+ it ( 'Passes listTitleProps to Title' , ( ) => {
496496 render (
497497 < ChatbotConversationHistoryNav
498498 onDrawerToggle = { onDrawerToggle }
499499 isDrawerOpen = { true }
500500 displayMode = { ChatbotDisplayMode . fullscreen }
501501 setIsDrawerOpen = { jest . fn ( ) }
502502 conversations = { { Today : initialConversations } }
503- titleProps = { { className : 'test' } }
503+ listTitleProps = { { className : 'test' } }
504504 />
505505 ) ;
506506 expect ( screen . getByRole ( 'heading' , { name : / T o d a y / i } ) ) . toHaveClass ( 'test' ) ;
507507 } ) ;
508508
509- it ( 'Overrides Title heading level when titleProps.headingLevel is passed' , ( ) => {
509+ it ( 'Overrides list title heading level when titleProps.headingLevel is passed' , ( ) => {
510510 render (
511511 < ChatbotConversationHistoryNav
512512 onDrawerToggle = { onDrawerToggle }
513513 isDrawerOpen = { true }
514514 displayMode = { ChatbotDisplayMode . fullscreen }
515515 setIsDrawerOpen = { jest . fn ( ) }
516516 conversations = { { Today : initialConversations } }
517- titleProps = { { headingLevel : 'h2' } }
517+ listTitleProps = { { headingLevel : 'h2' } }
518518 />
519519 ) ;
520520 expect ( screen . queryByRole ( 'heading' , { name : / T o d a y / i, level : 4 } ) ) . not . toBeInTheDocument ( ) ;
@@ -577,4 +577,33 @@ describe('ChatbotConversationHistoryNav', () => {
577577
578578 expect ( screen . getByRole ( 'dialog' , { name : / C h a t h i s t o r y I a m a s a m p l e s e a r c h / i } ) ) . toBeInTheDocument ( ) ;
579579 } ) ;
580+
581+ it ( 'overrides nav title heading level when navTitleProps.headingLevel is passed' , ( ) => {
582+ render (
583+ < ChatbotConversationHistoryNav
584+ onDrawerToggle = { onDrawerToggle }
585+ isDrawerOpen = { true }
586+ displayMode = { ChatbotDisplayMode . fullscreen }
587+ setIsDrawerOpen = { jest . fn ( ) }
588+ conversations = { { Today : initialConversations } }
589+ navTitleProps = { { headingLevel : 'h1' } }
590+ />
591+ ) ;
592+ expect ( screen . queryByRole ( 'heading' , { name : / C h a t h i s t o r y / i, level : 2 } ) ) . not . toBeInTheDocument ( ) ;
593+ expect ( screen . getByRole ( 'heading' , { name : / C h a t h i s t o r y / i, level : 1 } ) ) . toBeInTheDocument ( ) ;
594+ } ) ;
595+
596+ it ( 'overrides nav title icon when navTitleIcon is passed in' , ( ) => {
597+ render (
598+ < ChatbotConversationHistoryNav
599+ onDrawerToggle = { onDrawerToggle }
600+ isDrawerOpen = { true }
601+ displayMode = { ChatbotDisplayMode . fullscreen }
602+ setIsDrawerOpen = { jest . fn ( ) }
603+ conversations = { initialConversations }
604+ navTitleIcon = { < BellIcon data-testid = "bell" /> }
605+ />
606+ ) ;
607+ expect ( screen . getByTestId ( 'bell' ) ) . toBeInTheDocument ( ) ;
608+ } ) ;
580609} ) ;
0 commit comments