@@ -3,6 +3,21 @@ import ReactDOM from "react-dom";
33import ExamplePairing from "./ExamplePairing" ;
44import examples from "@open-rpc/examples" ;
55import refParser from "json-schema-ref-parser" ;
6+ import { OpenrpcDocument } from "@open-rpc/meta-schema" ;
7+
8+ it ( "renders handles no method" , async ( ) => {
9+ const div = document . createElement ( "div" ) ;
10+ ReactDOM . render ( < ExamplePairing method = { undefined } examplePosition = { 0 } /> , div ) ;
11+ expect ( div . innerHTML ) . toBe ( "" ) ;
12+ ReactDOM . unmountComponentAtNode ( div ) ;
13+ } ) ;
14+
15+ it ( "renders handles no method examples" , async ( ) => {
16+ const div = document . createElement ( "div" ) ;
17+ ReactDOM . render ( < ExamplePairing method = { { } as any } examplePosition = { 0 } /> , div ) ;
18+ expect ( div . innerHTML ) . toBe ( "" ) ;
19+ ReactDOM . unmountComponentAtNode ( div ) ;
20+ } ) ;
621
722it ( "renders handles no examplePosition" , async ( ) => {
823 const div = document . createElement ( "div" ) ;
@@ -11,7 +26,6 @@ it("renders handles no examplePosition", async () => {
1126 expect ( div . innerHTML ) . toBe ( "" ) ;
1227 ReactDOM . unmountComponentAtNode ( div ) ;
1328} ) ;
14- import { OpenrpcDocument } from "@open-rpc/meta-schema" ;
1529
1630it ( "renders examples" , async ( ) => {
1731 const div = document . createElement ( "div" ) ;
0 commit comments