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

Expose component testing code to outsiders #1413

Closed
3 tasks
ilyvion opened this issue Jul 14, 2020 · 3 comments · Fixed by #2310
Closed
3 tasks

Expose component testing code to outsiders #1413

ilyvion opened this issue Jul 14, 2020 · 3 comments · Fixed by #2310
Labels
feature-request A feature request
Milestone

Comments

@ilyvion
Copy link
Contributor

ilyvion commented Jul 14, 2020

I wanted to test my component's output, and I was informed of TestLayout:

pub(crate) struct TestLayout<'a> {

Unfortunately, it's private to the crate, so it cannot be used by outsiders. Consider making TestLayout public or possibly create something more suitable for general use that could help with testing component output expectations.

Questionnaire

  • I'm interested in implementing this myself but don't know where to start
  • I would like to add this feature
  • I don't have time to add this right now, but maybe later
@ilyvion ilyvion added the feature-request A feature request label Jul 14, 2020
@jstarry
Copy link
Member

jstarry commented Jul 14, 2020

Thanks for the issue!

I think it makes sense for this functionality to live in a yew-test crate. It can start with a simple with a way to render a component to an empty dom and assert the shape of the resulting html.

@bobbbay
Copy link

bobbbay commented Sep 15, 2021

It's been over a year, any update on this?

@ranile ranile added this to the v0.20 milestone Nov 25, 2021
@ranile
Copy link
Member

ranile commented Dec 28, 2021

This will be in a tests module:

#[cfg(tests)]
pub mod tests;

It can't be in it's own crate because it depends on interval APIs (like VDiff)

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

Successfully merging a pull request may close this issue.

4 participants