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

xilem_web: Testing #521

Open
casey opened this issue Aug 16, 2024 · 1 comment
Open

xilem_web: Testing #521

casey opened this issue Aug 16, 2024 · 1 comment
Labels

Comments

@casey
Copy link
Contributor

casey commented Aug 16, 2024

I have to admit seeing a PR like #518 without an accompanying test makes me a little nervous. It's so easy for stuff like this to regress in the future.

It would probably be straightforward to write headless browser-based tests, but my experience with such tests is that they're so slow, complex, and flaky to be almost not worth writing.

As an alternative, would it be possible to write a dummy DOM node implementation, and then run tests against that? For example, something like this:

struct TestNode {
  tag: String,
  properties: HashMap<String, String>,
  classes: HashSet<String>,
  children: Vec<TestNode>,
}

You could then write tests, and assert that dummy dom nodes were updated as expected.

@Philipp-M
Copy link
Contributor

I plan to investigate SSR soon, I think that may be combined (at least somewhat), with your idea of the TestNode.
Reason why I have not yet added tests, are that API changes are easier to make, but I guess we're consolidating slowly, so it probably makes sense to add them soon. I've also thought about headless browser-based tests, but as you say that may slow down CI significantly and requires a quite a little bit of setup.

@Philipp-M Philipp-M added the web label Aug 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants