This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { useState } from 'react'; | |
import { getMetalGenres } from './services/music-genres'; | |
import './App.css'; | |
function App() { | |
const [genreList, setGenreList] = useState(null); | |
const [error, setError] = useState(null); | |
const [isLoading, setIsLoading] = useState(false); | |
const handleFetchMetal = async () => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import { shallow, mount, render, act } from 'enzyme'; | |
import { getMetalGenres } from './services/music-genres'; | |
import App from './App'; | |
jest.mock('./services/music-genres'); | |
describe("App component", () => { | |
const genreList = [ | |
"Gothic Metal", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import { render, fireEvent, waitFor, waitForElement, wait, waitForDomChange } from '@testing-library/react'; | |
import { getMetalGenres } from './services/music-genres'; | |
import App from './App'; | |
jest.mock('./services/music-genres'); | |
describe("App component", () => { | |
let utils; | |
const genreList = [ |