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

Bug 1553719 - Trim revision id for compare chooser #5228

Merged

Conversation

airimovici
Copy link
Contributor

No description provided.

@airimovici airimovici changed the title WIP: Bug 1553719 - Trim revision id for compare chooser Bug 1553719 - Trim revision id for compare chooser Aug 5, 2019
@ionutgoldan ionutgoldan removed the WIP label Aug 5, 2019
@airimovici airimovici force-pushed the perf-compare-chooser-revision-id-trim branch from 1fc3cbd to 6706d97 Compare August 5, 2019 13:47
@@ -19,6 +19,12 @@ export const filterText = {
inputPlaceholder: 'filter text e.g. linux tp5o',
};

export const selectorCardText = {
Copy link
Contributor

Choose a reason for hiding this comment

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

Since you're moving the messages here to presumably make them reusable, it'd be worth giving the const a more generic name.

Edit: Nm - I realized they're being used for the tests.

@@ -136,10 +142,12 @@ export default class SelectorCard extends React.Component {
if (value === '') {
return this.setState({ validated: false });
}
// trim whitespaces before validating further
Copy link
Contributor

Choose a reason for hiding this comment

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

Not really necessary :)

expect(inputRevision).toBeInTheDocument();
expect(inputRevision.value).toBe(valid_hash);
expect(ref.current.state.invalidRevision).toBeFalsy();
expect(ref.current.state.validated).toBeTruthy();
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm curious why you're using a ref here to check for this text rather than using the react-testing-library queries?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for pointing it out. I changed it from asserting the state to checking with the testing-library queries.

Copy link
Contributor

@sarah-clements sarah-clements left a comment

Choose a reason for hiding this comment

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

This looks good, just a question about the use of refs. Thanks for adding the tests!

@airimovici
Copy link
Contributor Author

Thanks for the review, @sarah-clements. I removed the unnecessary comment and changed from checking the state to using the testing-library queries

@sarah-clements
Copy link
Contributor

I think you should be able to merge this (squash and merge keeping relevant commit messages) but if you can't let me know and I'll do it.

@ionutgoldan
Copy link
Contributor

I think you should be able to merge this (squash and merge keeping relevant commit messages) but if you can't let me know and I'll do it.

Alex is now on PTO. Thus, I'll perform the squash & merge.

@ionutgoldan ionutgoldan merged commit fd7f541 into mozilla:master Aug 7, 2019
@armenzg
Copy link
Collaborator

armenzg commented Aug 7, 2019

Deployed to production.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants