From 33fe90d7b51733d2cf5778b8bccf49066c752890 Mon Sep 17 00:00:00 2001 From: "Daniel J. Summers" Date: Tue, 2 Jan 2024 18:35:49 -0500 Subject: [PATCH] Add tests for hx-on attrs Fix broken link in README --- README.md | 8 ++++---- src/Tests/ViewEngine.fs | 7 +++++++ 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index a0d89ca..3490494 100644 --- a/README.md +++ b/README.md @@ -67,10 +67,10 @@ If you want to load htmx from unpkg, `Htmx.Script.minified` or `Htmx.Script.unmi ## Feedback / Help -The author hangs out in the #htmx-general channel of the [htmx Discord server](https://htmx.org/discord) and the #web channel of the [F# Software Foundation's Slack server](https://fsharp.org/guides/slack/). +The author hangs out in the #dotnet-htmx channel (and most others) of the [htmx Discord server](https://htmx.org/discord) and the #web channel of the [F# Software Foundation's Slack server](https://fsharp.org/guides/slack/). ## Thanks -|[Giraffe logo](https://giraffe.wiki)|[htmx logo](https://htmx.org)|[JetBrains Logo (Main)](https://jb.gg/OpenSource)| -| :---: | :---: | :---: | -|for making ASP.NET Core functional|for making HTML cool again|for licensing their tools to this project| +|[Giraffe logo](https://giraffe.wiki)| [htmx logo](https://htmx.org) |[JetBrains Logo (Main)](https://jb.gg/OpenSource)| +| :---: |:------------------------------------------------------------------------------------------------------------------------------------:| :---: | +|for making ASP.NET Core functional| for making HTML cool again |for licensing their tools to this project| diff --git a/src/Tests/ViewEngine.fs b/src/Tests/ViewEngine.fs index 69da20c..5f0de7f 100644 --- a/src/Tests/ViewEngine.fs +++ b/src/Tests/ViewEngine.fs @@ -740,6 +740,13 @@ let attributes = test "_hxNoBoost succeeds" { td [ _hxNoBoost ] [] |> shouldRender """""" } + test "_hxOnEvent succeeds" { + a [ _hxOnEvent "click" "doThis()" ] [] |> shouldRender """""" + } + test "_hxOnHxEvent succeeds" { + strong [ _hxOnHxEvent BeforeSwap "changeStuff()" ] [] + |> shouldRender """""" + } test "_hxParams succeeds" { br [ _hxParams "[p1,p2]" ] |> shouldRender """
""" }