1

I want to test a Reagent/Re-Frame view by asserting properties of the Hiccup markup it returns. Therefore I need functions that traverse the tree, filter it, or check that certain elements with certain attributes are present.

I can not be the first to have this problem, yet Google wasn't very helpful. Is there a library that does that? If not, how would you, e.g., write a function that traverses the markup and returns a seq of all elements with a certain tag?

2 Answers2

1

I'd be looking at:

There's a lot of ways of doing this it's hard to suggest a good answer

arcanine
  • 1,933
  • 1
  • 15
  • 22
-1

You can analyze and modify any tree-like data structure using the Tupelo Forest library. Please view the Lightning Talk video and peruse the many live examples.

If you add more detail to your question I can update the answer with something specific.

You can also see this answer.

Alan Thompson
  • 29,276
  • 6
  • 41
  • 48
  • 1
    It seems to me that `tupelo.forest` isn't available in ClojureScript, or am I doing something wrong? – Teresa Siegmantel Apr 24 '20 at 08:11
  • Oh, yes, it is CLJ only at present. I am working on an upgrade that will support CLJS also. You could use the `walk-with-parents-readonly` as a temporary workaround. – Alan Thompson Apr 24 '20 at 09:03