You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
547 B
19 lines
547 B
4 years ago
|
const expect = require("chai").expect;
|
||
|
const CompileReact = require("../lib/compileReact");
|
||
|
const { render, screen } = require("@testing-library/react");
|
||
|
// require("@testing-library/jest-dom/extend-expect");
|
||
|
require("jsdom");
|
||
|
|
||
|
describe("Compile AST to REACT elements", function () {
|
||
|
it("Simple react elements", function () {
|
||
|
const ast = [
|
||
|
{
|
||
|
type: "underline",
|
||
|
children: ["The ", { type: "bold", children: ["Apple"] }],
|
||
|
},
|
||
|
];
|
||
|
render(CompileReact(ast));
|
||
|
expect(screen.getByText("Apple")).toHaveTextContent("Apple");
|
||
|
});
|
||
|
});
|