UNPKG

753 BJavaScriptView Raw
1import React from "react";
2import { Change, Value } from "slate";
3import FontBgColor from "../";
4import renderer from "react-test-renderer";
5
6test("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});