mirror of
https://github.com/bigskysoftware/htmx.git
synced 2025-11-03 15:03:38 +00:00
add hx-target find selector test
This commit is contained in:
parent
df971a3667
commit
7e35a2ac41
@ -48,6 +48,18 @@ describe("hx-target attribute", function(){
|
|||||||
div1.innerHTML.should.equal("Clicked!");
|
div1.innerHTML.should.equal("Clicked!");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('targets a `find` element properly', function()
|
||||||
|
{
|
||||||
|
this.server.respondWith("GET", "/test", "Clicked!");
|
||||||
|
var div1 = make('<div hx-target="find span" hx-get="/test">Click Me! <div><span id="s1"></span><span id="s2"></span></div></div>')
|
||||||
|
div1.click();
|
||||||
|
this.server.respond();
|
||||||
|
var span1 = byId("s1")
|
||||||
|
var span2 = byId("s2")
|
||||||
|
span1.innerHTML.should.equal("Clicked!");
|
||||||
|
span2.innerHTML.should.equal("");
|
||||||
|
});
|
||||||
|
|
||||||
it('targets an inner element properly', function()
|
it('targets an inner element properly', function()
|
||||||
{
|
{
|
||||||
this.server.respondWith("GET", "/test", "Clicked!");
|
this.server.respondWith("GET", "/test", "Clicked!");
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user