Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shouldn't core_components.ex have some unit tests? #6148

Closed
jdmarshall opened this issue Mar 29, 2025 · 3 comments
Closed

Shouldn't core_components.ex have some unit tests? #6148

jdmarshall opened this issue Mar 29, 2025 · 3 comments

Comments

@jdmarshall
Copy link

There's a lot of complexity already in here, especially once you get into the livestream bits and these really should have tests. Especially if someone were inclined to create a PR to add more features or new components

Background:

I'm trying to write ul and ol components that work a bit like the table component.

Initially I couldn't get updates to work properly and had to fiddle a bit to get things to work right. I realized I probably should have written some tests for this so I get it right, and I couldn't work out how to test livestream support. So I figured I'd look at the table tests and test them the same way. Only... I could not find any tests associated with the core_components.ex file, either in the directory structure or in the commit history.

It would also be good to have more examples of how to write good tests for your own components, other than the tests generated in the templates which are a bit light.

@chrismccord
Copy link
Member

I’m not convinced we need unit level tests here and the tests our code generators generate naturally covers core component usage. You are of course welcome to add more in your app. Thanks!

@jdmarshall
Copy link
Author

How do you propose to avoid breaking changes from contributors if there are no tests to assert existing functionality?

@chrismccord
Copy link
Member

See integrationt_test/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants