-
Notifications
You must be signed in to change notification settings - Fork 62
Open
Description
I get a bunch of error messages when running the tests on page 259. I tried to do the following:
import React from "react";
import {App} from "./App.jsx";
import {render} from "react-dom";
import { createRoot } from 'react-dom/client';
import {act} from "react-dom/test-utils"
// @ts-ignore
global.IS_REACT_ACT_ENVIRONMENT = true
const container = document.createElement("div");
let root = createRoot(container)
test('renders the h1 header', () => {
act(()=> {
root.render(<App />);
});
const header = document.querySelector("h1");
expect(header.textContent).toBe("Cheesecakes: ")
});
But I get null passed to the header so the test fails.
If you could point me int he right direction that would be awesome.
Metadata
Metadata
Assignees
Labels
No labels