-
Notifications
You must be signed in to change notification settings - Fork 54
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
Add test helpers #470
Comments
Hello @PoignardAzur, While its primary focus is not unit testing, how about kittest? I think our main issue at the moment is that platform adapters each expose slightly different APIs, so providing some sort of testing helper would either mean adding a new adapter that UI toolkits would have to implement, or force testing functionalities into existing adapter. I'm not sure what's the best option. |
I don't need to interact with platform adapters. The tests could be purely-platform agnostics: my framework is already producing accessibility nodes, I only need accesskit to store them somewhere. |
If you only need a way to store nodes and query them in your tests, you could use accesskit_consumer directly. This is what the third-party kittest project does, apparently using one of our platform adapters as a starting point. |
Alright, I look into that crate. |
AccessKit currently helps you hook into platform APIs, but it doesn't provide an API to maintain and edit a node tree locally for unit tests.
Ideally, my testing workflow would be:
PersistentNodeTree
in my test harness.PersistentNodeTree
.PersistentNodeTree
, and check that it matches my expectations."Query some information" could mean getting a Node's value, checking that a given node is in the tree, that a node is another node's child, or just getting a debug representation so I can use
insta::assert_debug_snapshot
.Any thoughts?
The text was updated successfully, but these errors were encountered: