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

userData reducer test needs updating. #2317

Closed
BE-Webdesign opened this issue Aug 9, 2017 · 5 comments
Closed

userData reducer test needs updating. #2317

BE-Webdesign opened this issue Aug 9, 2017 · 5 comments
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.

Comments

@BE-Webdesign
Copy link
Contributor

BE-Webdesign commented Aug 9, 2017

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

@BE-Webdesign BE-Webdesign added [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. labels Aug 9, 2017
@notnownikki
Copy link
Member

I have an intermediate fix for this, which just makes sure that all the populated blocks are from the common category, but I'm not sure if it was merged, it's in one of @iseulde PRs which added a new block, but I can't locate it right now... Did it get merged?

@notnownikki
Copy link
Member

Found it: #2091

@notnownikki
Copy link
Member

The test fix is eef5278 I'll open a new PR with just that fix.

@notnownikki
Copy link
Member

#2365

@BE-Webdesign BE-Webdesign changed the title Uncertain behavior in userData reducer tests. Should we continue to have blocks be a global variable? Aug 11, 2017
@BE-Webdesign BE-Webdesign changed the title Should we continue to have blocks be a global variable? userData reducer test needs updating. Aug 11, 2017
@BE-Webdesign
Copy link
Contributor Author

Fixed by #2365

ceyhun pushed a commit that referenced this issue Jun 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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.
Projects
None yet
Development

No branches or pull requests

2 participants