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.
16 lines
474 B
16 lines
474 B
const expect = require("chai").expect;
|
|
const CompileReact = require("../lib/compileReact");
|
|
const { render, screen } = require("@testing-library/react");
|
|
|
|
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");
|
|
});
|
|
});
|
|
|