This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-04-23
Channels
- # babashka (18)
- # babashka-sci-dev (42)
- # beginners (84)
- # calva (11)
- # cider (5)
- # clj-kondo (11)
- # cljdoc (70)
- # cljs-dev (34)
- # clojure-europe (1)
- # clojurescript (3)
- # conjure (1)
- # core-async (29)
- # data-oriented-programming (10)
- # emacs (13)
- # fulcro (8)
- # gratitude (2)
- # honeysql (1)
- # introduce-yourself (4)
- # kaocha (10)
- # missionary (8)
- # nrepl (4)
- # off-topic (27)
- # portal (32)
- # releases (11)
- # tools-deps (11)
- # xtdb (19)
Has anyone had any luck using echarts-for-react? I think my problem is with the option in params.
["echarts-for-react" :default ReactECharts]
(def chart (interop/react-factory ReactECharts))
(chart :.classy
{:option {
:xAxis {
:type "category"
:data ["MON" "TUE" "WED" "THUR" "FRI" "SAT" "SUN"]
},
:yAxis {
:type "value"
},
:series [
{
:data [150, 230, 224, 218, 135, 147, 260],
:type "line"
}
]
}}
)
What is the error /problem?
@U036UJBDM5G :.classy
is a dom/
specific notation
["echarts-for-react" :default ReactECharts]
(def chart (interop/react-factory ReactECharts))
(chart
{:option {:xAxis {:type "category"
:data ["MON" "TUE" "WED" "THUR" "FRI" "SAT" "SUN"]},
:yAxis {:type "value"},
:series [{:data [150, 230, 224, 218, 135, 147, 260],
:type "line"}]}})
I threw the :.classy in there while troubleshooting, but never took it out. I got it working. The error was a component missing an empty map for props. @U4VT24ZM3 was right. It was not going work with that in there. Cheers for all your help!
For what it's worth, we just use echarts directly, without the react-wrapper. Needs just one useEffect to update the data/options, if those change.
Hello there. I'm looking for ways to test Fulcro frontend components but not sure how to approach this. There's a https://book.fulcrologic.com/#_testing about testing in Fulcro book, but it doesn't seem to cover anything specific about how to test Fulcro components. Does anyone have any materials I can have a look at on this? I'm pretty new to Fulcro FE testing in general. Thanks in advance.
I never felt the need 😅 I keep as much logic as possible in pure fns
you can:
• use @testing-library/react
for creating and firing events, querying dom elements, waiting for dom elements to reach certain states
• keep the logic out of components so you can test it in isolation, I'd recommend this for things that don't inherently deal with the dom a lot (i.e ok for fancy credit card input element) because actually testing dom is heavy and you'd rather tests are lightweight.
• use the new chrome devtools "recorder" functionality to create click-through user stories for more end-to-end stuff or some framework that does this.