on develop help sign in
Add test case to confirm correct processing of namespaces
commit9edad7dc7f03371a097a0b5deec9459724120864 authorJimmy Hartzell <jimmy.hartzell@obsidian.systems> dateTue 28 Jan 2020, 14:23 (7 years ago) parent5da52e8
1 file changed+9
reflex-dom-core/test/hydration.hs+9
reflex-dom-core/test/hydration.hs+9
@@ -770,6 +770,15 @@ tests withDebugging wdConfig caps _selenium = do
770770 prerender_ (pure ()) (liftIO $ trigger "Client")
771771 textNode $ TextNodeConfig "Initial" $ Just e
772772
773+ describe "namespaces" $ session' $ do
774+ it "dyn can be nested in namespaced widget" $ runWD $ do
775+ testWidget (pure ()) (checkTextInTag "svg" "one") $ do
776+ let svgRootCfg = def
777+ & elementConfig_namespace .~ Just "http://www.w3.org/2000/svg"
778+ & elementConfig_initialAttributes .~ ("width" =: "100%" <> "height" =: "100%" <> "viewBox" =: "0 0 1536 2048")
779+ void $ element "svg" svgRootCfg $ do
780+ dyn_ $ text "one" <$ pure ()
781+
773782 describe "runWithReplace" $ session' $ do
774783 it "works" $ runWD $ do
775784 replaceChan :: Chan Text <- liftIO newChan