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

useFetchTree specs #11766

Conversation

nucleogenesis
Copy link
Member

Summary

To streamline the process of getting realistic fixtures I just copied and pasted suitable raw API responses.

The one thing I've not covered is that the loading state changes during the fetch. I tried mocking @vueuse/core w/ a factory function returning a jest.fn for the set to check that it had been called with a value but ran into trouble with it because we're actually setting _loading and not the loading computed property. Maybe some kind of spy trickery could be used here but ultimately I didn't want to bang my head on it too much.

Covers the basics of fetching the tree, fetching more, and fetching a tree which doesn't have any more.

References

Marks one item complete in #11741

Reviewer guidance

Should anything else be covered here?

@nucleogenesis nucleogenesis added TODO: needs review Waiting for review TAG: unit tests Add or update tests labels Jan 23, 2024
@github-actions github-actions bot added APP: Coach Re: Coach App (lessons, quizzes, groups, reports, etc.) DEV: frontend SIZE: very large labels Jan 23, 2024
Copy link
Member

@rtibbles rtibbles left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixture is very useful - even if it lags my github code view! Tests all make sense to me.

@rtibbles rtibbles merged commit 4018146 into learningequality:develop Jan 25, 2024
31 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
APP: Coach Re: Coach App (lessons, quizzes, groups, reports, etc.) DEV: frontend SIZE: very large TAG: unit tests Add or update tests TODO: needs review Waiting for review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants