1 | import React from "react";
|
2 | import { Change, Value } from "slate";
|
3 | import FontBgColor from "../";
|
4 | import renderer from "react-test-renderer";
|
5 |
|
6 | test("create a FontBgColor icon", () => {
|
7 | const initialValue = Value.fromJSON({
|
8 | document: {
|
9 | nodes: [
|
10 | {
|
11 | object: "block",
|
12 | type: "paragraph",
|
13 | nodes: [
|
14 | {
|
15 | object: "text",
|
16 | leaves: [
|
17 | {
|
18 | text: "A line of text in a paragraph."
|
19 | }
|
20 | ]
|
21 | }
|
22 | ]
|
23 | }
|
24 | ]
|
25 | }
|
26 | });
|
27 |
|
28 | const component = renderer.create(
|
29 | <FontBgColor change={new Change({ value: initialValue })} />
|
30 | );
|
31 |
|
32 | let tree = component.toJSON();
|
33 | expect(tree).toMatchSnapshot();
|
34 | });
|