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

Fix RecentListens snapshot test #807

Merged
merged 2 commits into from Apr 14, 2020
Merged

Conversation

ishaanshah
Copy link
Collaborator

Description

Fixes the issue with failing snapshot test for RecentListens

Problem

The timestamp on RecentListens is calculated relative to the current time. This cause the snapshot tests to fail as the timestamp changes.

Solution

Mocking the timago.ago function to return a constant value make the snapshot test independent of
current time

Copy link
Collaborator

@paramsingh paramsingh left a comment

Choose a reason for hiding this comment

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

Why do you want to change it to shallow rendering here?

@ishaanshah
Copy link
Collaborator Author

Why do you want to change it to shallow rendering here?

Mount renders child components too. The Spotify Player was causing some warnings to pop up. As we are testing Spotify Player in it's own snapshot test and we want the tests to be independent, I think we should use shallow rendering.

@paramsingh paramsingh merged commit 4b47cf9 into metabrainz:master Apr 14, 2020
@ishaanshah ishaanshah deleted the test_fix branch April 14, 2020 16:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants