-
Notifications
You must be signed in to change notification settings - Fork 291
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
Validate have settings change alignment #8927
Validate have settings change alignment #8927
Conversation
Build files for 689cae9 have been deleted. |
Size Change: -152 B (-0.01%) Total Size: 1.55 MB
ℹ️ View Unchanged
|
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.
Looks good, but let's add a few extra tests and restore the removed documentation for the safe selector.
/** | ||
* Indicates whether the current settings have changed from what is saved. | ||
* | ||
* @since 1.6.0 | ||
* @since 1.77.0 Added ability to filter settings using `keys` argument. | ||
* @since 1.129.0 Changed the approach to use validateHaveSettingsChanged callback. | ||
* | ||
* @param {Object} state Data store's state. | ||
* @param {Array|null} keys Settings keys to check; if not provided, all settings are checked. | ||
* @return {boolean} True if the settings have changed, false otherwise. |
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.
Why remove the doc string for the selector? Let's keep it around (and update its documentation if needed, I'd think it would be since it's changed a bit now).
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.
I removed it since we don't have inline docs in other places for this kind of selectors, but yeah you are right, it makes more sense to keep it since we already have it
expect( validateHaveSettingsChanged ).toHaveBeenCalled(); | ||
} ); | ||
} ); | ||
|
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.
Let's add tests to ensure the "safe" selector (haveSettingsChanged
) never throws an exception when __dangerousHaveSettingsChanged
would throw.
@tofumatt Thanks, PR updated |
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.
Awesome, thanks 👍🏻
Summary
Addresses issue:
validateHaveSettingsChanged
Should Be Updated To Align With Existing Semantic Convention #8904PR Author Checklist
Do not alter or remove anything below. The following sections will be managed by moderators only.
Code Reviewer Checklist
Merge Reviewer Checklist