Teresa Siegmantel
Teresa Siegmantel

Reputation: 903

Querying Reagent/Hiccup Markup For Tests

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?

Upvotes: 1

Views: 202

Answers (2)

arcanine
arcanine

Reputation: 1953

I'd be looking at:

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

Upvotes: 1

Alan Thompson
Alan Thompson

Reputation: 29984

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.

Upvotes: 0

Related Questions