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

Blocks: Fix meta attributes selector not returning the correct value if edited #3754

Merged
merged 1 commit into from
Dec 1, 2017

Conversation

youknowriad
Copy link
Contributor

I think the editor's state has been refactored at some point which introduced this regression. This is probably worth a unit test but I have to go to WCUS right now. Feel free to add it if possible.

Testing instructions

  • Add a block with a "meta" attribute
  • Try to update the value
  • The value should update as soon as you type.

@youknowriad youknowriad added the [Type] Bug An existing feature does not function as intended label Dec 1, 2017
@youknowriad youknowriad self-assigned this Dec 1, 2017
@youknowriad youknowriad requested a review from mcsf December 1, 2017 13:16
@codecov
Copy link

codecov bot commented Dec 1, 2017

Codecov Report

Merging #3754 into master will increase coverage by 2.37%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3754      +/-   ##
==========================================
+ Coverage   37.67%   40.04%   +2.37%     
==========================================
  Files         279      279              
  Lines        6737     7179     +442     
  Branches     1226     1369     +143     
==========================================
+ Hits         2538     2875     +337     
- Misses       3538     3615      +77     
- Partials      661      689      +28
Impacted Files Coverage Δ
editor/selectors.js 93.54% <100%> (+0.08%) ⬆️
editor/store.js 81.81% <0%> (-1.52%) ⬇️
editor/components/block-list/block.js 1.86% <0%> (-0.38%) ⬇️
editor/store-defaults.js 100% <0%> (ø) ⬆️
blocks/api/raw-handling/test/integration/index.js 100% <0%> (ø) ⬆️
blocks/hooks/index.js 100% <0%> (ø) ⬆️
blocks/api/registration.js 100% <0%> (ø) ⬆️
blocks/block-edit/index.js 100% <0%> (ø) ⬆️
components/higher-order/with-api-data/index.js 84.33% <0%> (+0.58%) ⬆️
... and 4 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8b5594d...e37fcda. Read the comment docs.

Copy link
Contributor

@mcsf mcsf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fix is good.

I think the editor's state has been refactored at some point which introduced this regression.

Yes, I believe in 2c0ada2 (#3298).

This is probably worth a unit test

Agreed, but the tricky part is that we don't have anything using meta attributes in core blocks. If we did, we'd have an obvious place to add a test simulating user input into meta, as a canary for all the moving parts of meta attributes. Obviously, we can just add a selector test for getPostMeta, but it wouldn't catch state schema changes.

but I have to go to WCUS right now.

As one does daily. 😁

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants