mardi 19 décembre 2017

Enzyme Cannot Find Component /

I am using "react": "^15.5.4" and "enzyme": "^2.8.2"

Given the following output from wrapper.debug():

<CellRenderer idx={4} rowIdx={0} height={35} column= 
              cellMetaData= value={3} rowData= 
              isRowSelected={false} expandableOptions=
              selectedColumn={[undefined]} formatter={[undefined]} 
              isScrolling={true}>

              <Cell idx={4} rowIdx={0} height={35} column=
                    cellMetaData= value={3} rowData=
                    isRowSelected={false} expandableOptions= 
                    selectedColumn={[undefined]} formatter={[undefined]} 
                    isScrolling={true} className="" tooltip=""
                    tabIndex={-1} isExpanded={false} isCellValueChanging={[Function]}>

                    <div height={35} tabIndex={-1} value={3} className="react-grid-Cell" 
                         style= onClick={[Function]} onDoubleClick={[Function]} 
                         onContextMenu={[Function]} onDragOver={[Function]}>

                         <div className="react-grid-Cell__value">
                              <div style=>
                                   <span>
                                         <SimpleCellFormatter value={3}>
                                                <div title={3}>
                                                  3
                                                </div>

I cannot find any of the elements I need using:

  • wrapper.find(wrapper.findWhere(n => n.name() === 'CellRenderer'))
  • wrapper.find("div[title='3']"
  • wrapper.find("div[value='3']")

    Any idea what could be the reason?

Aucun commentaire:

Enregistrer un commentaire