Giter VIP home page Giter VIP logo

Comments (5)

1cg avatar 1cg commented on July 16, 2024

Can you create a regression test in /test/core/regressions.js?

from htmx.

jsantari avatar jsantari commented on July 16, 2024

Not familiar with doing that.

from htmx.

1cg avatar 1cg commented on July 16, 2024

Check out these tests:

https://github.com/bigskysoftware/kutty/blob/master/test/attributes/kt-swap-oob.js

Basically you set up a mock server response or two, create an html fragment using make and then click it and assert stuff about the response.

Of if you like you can just post the stuff into this ticket and I'll do it. But I'd love to test the regression contribution process :)

from htmx.

jsantari avatar jsantari commented on July 16, 2024

Sorry - I don't have time to experiment with that. I've provided a link to the two page simple example.
First page content inside body is:

<h1 kt-get='index2a.php' kt-target="#page2" kt-trigger='click'>Kutty CLICK ME</h1>

<div id="page2" ></div>
<div id="message"></div>
<div id="message2"></div>

Index2a.php contains the following html for the response:

<div id='message' kt-swap-oob='true'><h3>I came from message oob swap I should be second</h3></div>
<div id='message2' kt-swap-oob='true'><h4>I came from a message2 oob swap I should be third  but I am in the wrong spot</h4></div>
<h3>I'm page2 content (non-swap) I should be first</h3>

If you look at the example page link I provided you'll see that message2 ends up in the wrong spot.

from htmx.

1cg avatar 1cg commented on July 16, 2024

Thanks for the report, I created a regression test based on your code:

https://github.com/bigskysoftware/kutty/blob/d4b4d462ab577a8e481e07e540bb3bc4343476c6/test/core/regressions.js#L21

And an attribute test that simplifies it:

https://github.com/bigskysoftware/kutty/blob/d4b4d462ab577a8e481e07e540bb3bc4343476c6/test/attributes/kt-swap-oob.js#L21

Both on line 21? Crazy.

Anyway, you can grab the latest src from the 'dev' branch or wait until next friday when I'm going to push 0.1.0

from htmx.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.