Skip to content

Commit

Permalink
test checked
Browse files Browse the repository at this point in the history
  • Loading branch information
shahrul committed Oct 11, 2024
1 parent 34ab348 commit 55b6e49
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion test/9_input2.luax
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ local todo = { id="1", done = false }
return <input
class="toggle"
type="checkbox"
checked={'' or nil}
checked={todo.done and "" or nil}
hx-patch="/toggle-todo?id="..{todo.id}.."&done="..{tostring(todo.done)}
hx-target="closest <li/>"
hx-swap="outerHTML"
Expand Down
2 changes: 1 addition & 1 deletion test/test_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ describe("LuaX", function()
it("should return a HTML string when given input node", function()
local el = require("test.9_input2")
assert.is.equal(
'<input _="install TodoCheck" checked="" class="toggle" hx-patch="/toggle-todo?id=1&done=false" hx-swap="outerHTML" hx-target="closest <li/>" type="checkbox">',
'<input _="install TodoCheck" class="toggle" hx-patch="/toggle-todo?id=1&done=false" hx-swap="outerHTML" hx-target="closest <li/>" type="checkbox">',
h(el))
end)

Expand Down

0 comments on commit 55b6e49

Please sign in to comment.