0

Need to test the React.createRef() part, but that is passed as a prop to the child component.

 return (
      <div id="excel">
        <BuilderWrapper className="builderWrapper">
          <Header name={name} desc={description} exportHandler={this.exportHandler} showData={this.showData} />
          <BuilderNotification>
            <Message infoMessage={cmsContent.messageOnExcelSheet} />
          </BuilderNotification>
          <BuilderSpreadsheet>
            **<HotTable ref={this.hotTableComponent} {...this.setting} className={headerBoldCustom} />**
          </BuilderSpreadsheet>
          <HotFooter dimensions={dimensions} />
        </BuilderWrapper>
      </div>
    );
brass monkey
  • 5,841
  • 10
  • 36
  • 61
Megha Rawat
  • 185
  • 2
  • 10
  • What do you need to test? normally you should not have to test a framework, rather the implementation of the framework. As for testing `ref={}`, there is nothing to really test. – Beaulne Apr 10 '19 at 19:07
  • 1
    Hi, check this https://stackoverflow.com/questions/37647061/how-do-i-access-refs-of-a-child-component-in-the-parent-component – igorves Apr 10 '19 at 20:05
  • Thanks @igorves :) – Megha Rawat Apr 12 '19 at 12:58

0 Answers0