Skip to content

Commit 81d33e0

Browse files
committed
fix: improve test coverage of Documentation component
1 parent 661d5b8 commit 81d33e0

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/Documentation.test.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,9 @@ it("renders without crashing", () => {
77
ReactDOM.render(<Documentation schema={{} as any}/>, div);
88
ReactDOM.unmountComponentAtNode(div);
99
});
10+
11+
it("renders without crashing with no schema", () => {
12+
const div = document.createElement("div");
13+
ReactDOM.render(<Documentation />, div);
14+
ReactDOM.unmountComponentAtNode(div);
15+
});

src/Documentation.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import ContentDescriptors from "./ContentDescriptors/ContentDescriptors";
66
import { OpenrpcDocument } from "@open-rpc/meta-schema";
77

88
interface IProps {
9-
schema: OpenrpcDocument;
9+
schema?: OpenrpcDocument;
1010
uiSchema?: any;
1111
reactJsonOptions?: any;
1212
methodPlugins?: Array<React.FC<IMethodPluginProps>>;

0 commit comments

Comments
 (0)