userData reducer test needs updating. #2317
Labels
[Type] Automated Testing
Testing infrastructure changes impacting the execution of end-to-end (E2E) and/or unit tests.
[Type] Bug
An existing feature does not function as intended
[Type] Question
Questions about the design or development of the editor.
Issue Overview
One of the userData reducer tests in editor/test/state is not clearing out the global blockTypes correctly.
It "should populate recently used blocks with the common category", which it does, just not the expected result in the test suite. You can see the failing tests in the #2299, and #2309. Not sure if the test is expecting the wrong thing, or if the data is not being cleared. This issue has deeper roots as it is tied to the global blockTypes state.
Expected Behavior
According to the tests only two blockTypes should appear in the array, instead 8 do. It is unclear what the expected outcome of the test should be, but based on the test suite it looks as though the tests are not cleaning up themselves properly.
Current Behavior
It seems to be passing in other branches that are not adding new blocks.
Possible Solution
A possible solution might be clearing out all registered types on the after hook. A better long term solution is to introduce blockType registries and have independent fixtures be used for tests that need a certain set of blocks. This would make our test suite run slightly faster as well. This will also make the ability to have selective sets of blocks for different contexts a lot easier to manage.
Related Issues and/or PRs
#2309, #2299
The text was updated successfully, but these errors were encountered: