diff --git a/BrowserTests/Package.swift b/BrowserTests/Package.swift index 8e7a3ae..f3662da 100644 --- a/BrowserTests/Package.swift +++ b/BrowserTests/Package.swift @@ -24,7 +24,10 @@ addPage(name: "QSComponents") addPage(name: "QSMarkup") addPage(name: "QSDisplayingData") addPage(name: "QSConditional") -addPage(name: "QSRenderingLists") +addPage(name: "QSLists") +addPage(name: "QSEvents") +addPage(name: "QSUpdating") +addPage(name: "QSSharing") let package = Package( name: "BrowserTests", diff --git a/BrowserTests/Sources/BRTSupport/RenderRoot.swift b/BrowserTests/Sources/BRTSupport/RenderRoot.swift index 0d0f292..8a085c4 100644 --- a/BrowserTests/Sources/BRTSupport/RenderRoot.swift +++ b/BrowserTests/Sources/BRTSupport/RenderRoot.swift @@ -2,8 +2,11 @@ import React import JavaScriptKit import SRTDOM +public var root: ReactRoot? = nil + public func renderRoot(component: some Component) throws { let body = try JSWindow.global.document.body.unwrap("body") let root = ReactRoot(element: body) + BRTSupport.root = root root.render(node: component) } diff --git a/BrowserTests/Sources/BRTSupport/common.css b/BrowserTests/Sources/BRTSupport/common.css new file mode 100644 index 0000000..cae8efc --- /dev/null +++ b/BrowserTests/Sources/BRTSupport/common.css @@ -0,0 +1,55 @@ +* { + box-sizing: border-box; +} + +body { + font-family: sans-serif; + margin: 20px; + padding: 0; +} + +h1 { + margin-top: 0; + font-size: 22px; +} + +h2 { + margin-top: 0; + font-size: 20px; +} + +h3 { + margin-top: 0; + font-size: 18px; +} + +h4 { + margin-top: 0; + font-size: 16px; +} + +h5 { + margin-top: 0; + font-size: 14px; +} + +h6 { + margin-top: 0; + font-size: 12px; +} + +code { + font-size: 1.2em; +} + +ul { + padding-inline-start: 20px; +} + +.avatar { + border-radius: 50%; +} + +.large { + border: 4px solid gold; +} diff --git a/BrowserTests/Sources/GenPagesModule/GenPages.swift b/BrowserTests/Sources/GenPagesModule/GenPages.swift index 08a5667..6e1e4ef 100644 --- a/BrowserTests/Sources/GenPagesModule/GenPages.swift +++ b/BrowserTests/Sources/GenPagesModule/GenPages.swift @@ -40,6 +40,7 @@ public struct GenPages {