File tree Expand file tree Collapse file tree 3 files changed +14
-1
lines changed
Expand file tree Collapse file tree 3 files changed +14
-1
lines changed Original file line number Diff line number Diff line change 6868 "@types/d3-shape" : " ^3.1.0" ,
6969 "@types/point-in-polygon" : " ^1.1.1" ,
7070 "@types/react" : " ^17.0.45" ,
71+ "@types/react-dom" : " ^18.0.10" ,
7172 "@zakodium/eslint-config" : " ^6.0.0" ,
7273 "eslint" : " ^8.29.0" ,
7374 "isotopic-distribution" : " ^1.4.15" ,
Original file line number Diff line number Diff line change 1+ import { test , expect } from '@playwright/experimental-ct-react' ;
2+ import { ServerSide } from './utils' ;
3+
4+ test ( 'should render a plot in server-side mode' , async ( { mount } ) => {
5+ const plot = await mount ( < ServerSide /> ) ;
6+ const html = await plot . innerHTML ( ) ;
7+ expect ( html ) . toContain ( 'svg' ) ;
8+ } ) ;
Original file line number Diff line number Diff line change 11import { ReactNode , useState } from 'react' ;
2+ import { renderToStaticMarkup } from 'react-dom/server' ;
23
34import { Annotations , Plot , ScatterSeries } from '../src' ;
45import { Arrow } from '../src/components/Annotations/Arrow' ;
@@ -13,7 +14,10 @@ interface ChildrenProps {
1314export function DefaultPlotTest ( { children } : ChildrenProps ) {
1415 return < Plot { ...DEFAULT_PLOT_CONFIG } > { children } </ Plot > ;
1516}
16-
17+ export function ServerSide ( ) {
18+ const html = renderToStaticMarkup ( < InfraredPlotTest /> ) ;
19+ return < div dangerouslySetInnerHTML = { { __html : html } } /> ;
20+ }
1721export function InfraredPlotTest ( { children } : ChildrenProps ) {
1822 return (
1923 < DefaultPlotTest >
You can’t perform that action at this time.
0 commit comments