Make preferences reducer deterministic (again) #5518
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In #5423, we updated
INSERT_BLOCKS
andREPLACE_BLOCKS
to contain atime
property which contains the current timestamp (Date.now()
). This required updating our effects tests to be less strict in what they asserted. Namely, we had to allowtime
to be any number (expect.any( Number )
).Unfortunately, I made a mistake and did not update two tests that needed to be less strict.
npm test
and Travis CI did not catch my mistake as the tests happened to run fast enough such thatDate.now()
returned the same timestamp for both the expected result and the actual result. I reverted the PR (#5517) when I noticed the error showing up in unrelated Travis builds.This PR reverts the revert and updates the two test cases that I missed. To check that I correctly handled every case, I applied this diff and ran
npm test
.😅