Please write tests for the below React (v17) component using Mocha, Chai, Enzyme and sinon (if needed):

import React, {useState, useEffect} from 'react';
import getData from './getData';

const Foo = () => {
  const [data, setData] = useState([]);

  useEffect(() => {
    getData().then(data => {
        setData(data)
    })
  }, [])

  return data.length ? <h1>data.length</h1> : 'loading';
}