-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
feat(Codecov): Add tests for datePicker components #89341
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
Conversation
ConfigStore.loadInitialData( | ||
ConfigFixture({ | ||
user: UserFixture({ | ||
options: {...UserFixture().options, timezone: 'America/New_York'}, | ||
}), | ||
}) | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this can be simplified a bit
ConfigStore.loadInitialData( | |
ConfigFixture({ | |
user: UserFixture({ | |
options: {...UserFixture().options, timezone: 'America/New_York'}, | |
}), | |
}) | |
); | |
ConfigStore.set('user', UserFixture({timezone: 'America/New_York'})); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you probably don't need to setup the config store at all
function getComponent(props = {}) { | ||
return <DateSelector onChange={onChange} {...props} />; | ||
} | ||
|
||
function renderComponent(props = {}) { | ||
return render(getComponent(props), {router}); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the props types here are {}
. Putting <DateSelector onChange={onChange} />
in each test saves pain later
const {router} = initializeOrg({ | ||
router: { | ||
location: { | ||
pathname: '/codecov/tests/', | ||
query: {}, | ||
}, | ||
params: {}, | ||
}, | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you probably don't need this either
Thanks for the feedback @scttcper, agree with your suggestions and got rid of some code |
❌ 1 Tests Failed:
View the top 1 failed test(s) by shortest run time
To view more test analytics, go to the Test Analytics Dashboard |
Adds tests for the components in #89117. It also moves around those components for better folder structure.
Suspect IssuesThis pull request was deployed and Sentry observed the following issues:
Did you find this useful? React with a 👍 or 👎 |
Adds tests for the components in #89117. It also moves around those components for better folder structure.