tempest-framework icon indicating copy to clipboard operation
tempest-framework copied to clipboard

test(view): add test that attribute dashes are preserved

Open NeoIsRecursive opened this issue 1 year ago • 1 comments

I often use data attributes for doing styling, and inertia for example requires a data-page="bunchofjsondata to work, right now that doesn't seem to work :( (my guess is there is someplace where it is camelCased).

So this PR adds a (failing) test for that :)

NeoIsRecursive avatar Oct 11 '24 14:10 NeoIsRecursive

Hey @NeoIsRecursive! Thanks for the PR. It looks like CI is failing for another reason (which I will look into). Do you mind posting the output of composer phpunit from your local machine so we can review?

aidan-casey avatar Oct 11 '24 18:10 aidan-casey

Hey @NeoIsRecursive! Thanks for the PR. It looks like CI is failing for another reason (which I will look into). Do you mind posting the output of composer phpunit from your local machine so we can review?

Yes of course! I also created an issue (#583)

PHPUnit output:

There was 1 failure:

1) Tests\Tempest\Integration\View\ViewTest::test_render_element_with_attribute_with_dash
Failed asserting that '<div dataTheme="tempest"></div>' [ASCII](length: 31) contains "<div data-theme="tempest"></div>" [ASCII](length: 32).

NeoIsRecursive avatar Oct 13 '24 10:10 NeoIsRecursive

Thanks for the test! I copied it manually to a new branch so that I could immediately make a fix for it. So I'm sorry I'm closing the PR and you're not getting attributed for the contribution, but I do appreciate it! 😁

https://github.com/tempestphp/tempest-framework/pull/585

brendt avatar Oct 13 '24 12:10 brendt