File tree Expand file tree Collapse file tree 3 files changed +9
-6
lines changed
plugins/UnitTranslationPlugin/feedback-widget Expand file tree Collapse file tree 3 files changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -141,7 +141,7 @@ exports[`<FeedbackWidget /> renders hidden by default 1`] = `
141141
142142exports [` <FeedbackWidget /> renders show when elemReady is true 1` ] = `
143143<div
144- className = " sequence-container d-inline-flex flex-row"
144+ className = " sequence-container d-inline-flex flex-row w-100 "
145145>
146146 <div
147147 className = " sequence w-100"
Original file line number Diff line number Diff line change @@ -42,8 +42,8 @@ const FeedbackWidget = ({
4242 } , [ ref . current ] ) ;
4343
4444 return (
45- ( showFeedbackWidget || showGratitudeText ) && (
46- < div ref = { ref } className = { elemReady ? 'sequence-container d-inline-flex flex-row' : 'd-none' } >
45+ < div ref = { ref } className = { ( elemReady ) ? 'sequence-container d-inline-flex flex-row w-100' : 'd-none' } >
46+ { ( showFeedbackWidget || showGratitudeText ) ? (
4747 < div className = "sequence w-100" >
4848 {
4949 showFeedbackWidget && (
@@ -99,8 +99,8 @@ const FeedbackWidget = ({
9999 )
100100 }
101101 </ div >
102- </ div >
103- )
102+ ) : null }
103+ </ div >
104104 ) ;
105105} ;
106106
Original file line number Diff line number Diff line change @@ -82,9 +82,11 @@ describe('<FeedbackWidget />', () => {
8282 showFeedbackWidget : false ,
8383 showGratitudeText : false ,
8484 } ) ;
85+ useState . mockReturnValueOnce ( [ true , jest . fn ( ) ] ) ;
8586 const wrapper = shallow ( < FeedbackWidget { ...props } /> ) ;
86- expect ( wrapper . isEmptyRender ( ) ) . toBe ( true ) ;
87+ expect ( wrapper . instance . findByType ( 'div' ) [ 0 ] . children . length ) . toBe ( 0 ) ;
8788 } ) ;
89+
8890 it ( 'render feedback widget' , ( ) => {
8991 mockUseFeedbackWidget ( {
9092 showFeedbackWidget : true ,
@@ -93,6 +95,7 @@ describe('<FeedbackWidget />', () => {
9395 const wrapper = shallow ( < FeedbackWidget { ...props } /> ) ;
9496 expect ( wrapper . snapshot ) . toMatchSnapshot ( ) ;
9597 } ) ;
98+
9699 it ( 'render gratitude text' , ( ) => {
97100 mockUseFeedbackWidget ( {
98101 showFeedbackWidget : false ,
You can’t perform that action at this time.
0 commit comments