File tree Expand file tree Collapse file tree 1 file changed +34
-0
lines changed
packages/math-input/src/components/keypad/__tests__ Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Original file line number Diff line number Diff line change @@ -99,6 +99,40 @@ describe("keypad", () => {
9999 expect ( container ) . toMatchSnapshot ( "first render" ) ;
100100 } ) ;
101101
102+ it ( `shows optional dismiss button` , async ( ) => {
103+ // Arrange
104+ // Act
105+ render (
106+ < Keypad
107+ onClickKey = { ( ) => { } }
108+ onAnalyticsEvent = { async ( ) => { } }
109+ showDismiss
110+ /> ,
111+ ) ;
112+
113+ // Assert
114+ expect (
115+ screen . getByRole ( "button" , {
116+ name : "Dismiss" ,
117+ } ) ,
118+ ) . toBeInTheDocument ( ) ;
119+ } ) ;
120+
121+ it ( `hides optional dismiss button` , ( ) => {
122+ // Arrange
123+ // Act
124+ render (
125+ < Keypad onClickKey = { ( ) => { } } onAnalyticsEvent = { async ( ) => { } } /> ,
126+ ) ;
127+
128+ // Assert
129+ expect (
130+ screen . queryByRole ( "button" , {
131+ name : "Dismiss" ,
132+ } ) ,
133+ ) . not . toBeInTheDocument ( ) ;
134+ } ) ;
135+
102136 it ( `shows the dot symbol when convertDotToTimes is false` , async ( ) => {
103137 // Arrange
104138 // Act
You can’t perform that action at this time.
0 commit comments