File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed
packages/mui-material/src/Chip Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -733,4 +733,28 @@ describe('<Chip />', () => {
733733 ) . not . to . throw ( ) ;
734734 } ) ;
735735 } ) ;
736+
737+ it ( 'should not throw on clicking Chip when onClick is not provided' , ( ) => {
738+ expect ( ( ) => {
739+ const { getByTestId } = render ( < Chip data-testid = "chip" /> ) ;
740+ const chip = getByTestId ( 'chip' ) ;
741+ fireEvent . click ( chip ) ;
742+ } ) . not . throw ( ) ;
743+ } ) ;
744+
745+ it ( 'should not throw on keydown when onKeyDown is not provided' , ( ) => {
746+ expect ( ( ) => {
747+ const { getByTestId } = render ( < Chip data-testid = "chip" /> ) ;
748+ const chip = getByTestId ( 'chip' ) ;
749+ fireEvent . keyDown ( chip , { key : 'Enter' } ) ;
750+ } ) . not . throw ( ) ;
751+ } ) ;
752+
753+ it ( 'should not throw on keyup when onKeyUp is not provided' , ( ) => {
754+ expect ( ( ) => {
755+ const { getByTestId } = render ( < Chip data-testid = "chip" /> ) ;
756+ const chip = getByTestId ( 'chip' ) ;
757+ fireEvent . keyUp ( chip , { key : ' ' } ) ;
758+ } ) . not . throw ( ) ;
759+ } ) ;
736760} ) ;
You can’t perform that action at this time.
0 commit comments