https://storybook.js.org/ is a pretty popular JS tool for interactive UI testing.
I was debugging the JS tool integration of shadow-cljs
and had to pick a JS tool so I picked storybook. It works quite well and looks nice.
It can produce static output which is sort of neat for demo purposes:
https://code.thheller.com/demos/storybook-static
In CLJS we have devcards but with a few macros the storybook integration could be pretty good as well. I used their react guide and ported a quick demo to CLJS.
(ns demo.app-stories
(:require
["@storybook/react" :refer (storiesOf)]
["@storybook/addon-actions" :refer (action)]
[shadow.markup.react :as html :refer (defstyled)]))
(defstyled big-button :button [_]
{:font-size "2em"})
;; FIXME: write macro to make this nicer
(-> (storiesOf "Button CLJS" js/module)
(.add "Normal" #(html/button {:onClick (action "click")} "Hello World"))
(.add "Big" #(big-button {:onClick (action "big click")} "Hello World")))
Full code:
https://github.com/thheller/shadow-cljs-examples/tree/master/cljs-storybook