hiccup icon indicating copy to clipboard operation
hiccup copied to clipboard

Add tests borrowed from Hiccup's test suite and make small tweaks to match Hiccup/Reagent behavior.

Open alysbrooks opened this issue 2 years ago • 5 comments

So far, the only divergence that has a semantic difference is our handling of conflicts between attributes in the map and tag. I think we want to follow Reagent's handling, but I don't know what that is yet.

  • [x] Verify it's okay to use Eclipse-licensed code in a project using the Mozilla Public License. I think these licenses are effectively identical, but IMO, it's worth double checking.
  • [x] Divide failing tests into two buckets: skip and write up and issue (because we'll fix later) and amend and document (because we like how our behavior diverges).
  • [x] Figure out how Reagent handles the conflicting scenario.

alysbrooks avatar Mar 20 '23 16:03 alysbrooks

Based on looking into it further, MPL and EPL are very similar and as far as I can tell, can be combined freely.

alysbrooks avatar May 26 '23 19:05 alysbrooks

Latest version of Reagent's test suite: https://github.com/reagent-project/reagent/blob/master/src/reagent/impl/template.cljs. While I'm just integrating Hiccup tests for now, I'm trying to avoid introducing any incompatibilities.

alysbrooks avatar May 26 '23 20:05 alysbrooks

I think we can merge this after #5.

alysbrooks avatar Jun 13 '23 04:06 alysbrooks

I believe that #7 would have been caught by these tests.

alysbrooks avatar Aug 01 '23 04:08 alysbrooks

Caught more issues introduced (I'm pretty sure) by #5:

  • If the class is specified in the initial keyword and the attribute map (e.g., [:div.foo {:class "bar"} "baz"]), it's now rendering twice, as "<div id="baq" id="bar" class="foo">baz</div>"
  • ~~Fragments don't seem to work anymore. E.g., [:div [test-fragment-component "hello"]] gets rendered as "<div><<>nn><p>hello</p><p>hello</p></<>nn></div>"~~

The latter might be due to the interaction between #5 and this PR since I think the fragment test existed prior to this PR.

Never mind, that second issue was caused by a typo I introduced during rebase.

alysbrooks avatar Aug 01 '23 04:08 alysbrooks