Fork me on GitHub
#fulcro
<
2022-04-23
>
Patrick Brown01:04:03

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" } ] }} )

Jakub Holý (HolyJak)18:04:22

What is the error /problem?

Björn Ebbinghaus18:04:09

@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"}]}})

❤️ 1
Patrick Brown19:04:03

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!

Hukka06:04:28

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.

❤️ 1
aratare13:04:10

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.

Jakub Holý (HolyJak)18:04:45

I never felt the need 😅 I keep as much logic as possible in pure fns

bbss02:04:08

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.