Fix: reducer tested properties not related to replaceInnerBlocks action while testing that action #15002
Fix: reducer tested properties not related to replaceInnerBlocks action while testing that action #15002jorgefilipecosta wants to merge 1 commit into
Conversation
…ith the replace functionality.
aduth
left a comment
There was a problem hiding this comment.
Personally, I'd rather the verbosity than run the risk that there's some strange edge case where a wildly-unexpected value is assigned for one of these properties, or somehow additional unexpected properties become included in state. In other words, I don't think they should be considered as "not related to the action" because all of the state is always relevant to any action the reducer manages.
Hi @aduth thank you for sharing your thoughts. In that case, I will close the PR, and follow the same line of thought in future similar situations. |
Initially, during #14291, I noticed that in the reducer that tests for the replaceInnerBlocks action there has a property that was not relevant to this tests and so I did not check it ( used isPersistentChange: expect.anything())
Meanwhile, in #14916 the expect anything was removed and the tests were updated to take into account a new property.
I think these tests should use toMatchObject to make sure new properties added in the future not related to the action we are testing don't have an impact on the tests.
cc: @aduth
How has this been tested?
I verified the unit tests pass.