jeudi 13 juin 2019

How to test if a chart is loaded or not using jest?

I have an App.js whose code is below:

  function App() {
    return (
        <div className="App">
          <Sidebar/>
          <div id="chart-div">
              <p>Click on one of the links on the left</p>
          </div>
        </div>
      );
    }

    export default App;

I have written a code in Sidebar.js to display a chart in <div id="chart-div"> using Google Charts and when the chart loads, it removes the <p> tag and replaces it with a <div> containing an SVG graph.

Is it possible to write a test using jest to check whether the chart has loaded or not?

Aucun commentaire:

Enregistrer un commentaire