We're now ready to make failing test pass:
- Add import to test/Appointment.test.js, below the two React imports:
import { Appointment } from '../src/Appointment';
- Run tests with npm test. You'll get a different error this time:
Cannot find module '../src/Appointment' from 'Appointment.test.js'
Although Appointment was defined as an export, it wasn't defined as a default export. That means we have to import it using the curly brace from of import (import { ... }). I tend to avoid using default exports; doing so keeps the name of my component and its usage in sync: if I change the name of a component, then every place where it's imported will break unless I change those too. This isn't the case with default exports. Once your ...