Automattic / vip-block-data-api

WordPress plugin that provides an API to retrieve Gutenberg content as structured JSON.
http://wpvip.com
GNU General Public License v3.0
97 stars 7 forks source link

Add test for default value handling in parser #70

Closed alecgeatches closed 1 month ago

alecgeatches commented 1 month ago

Description

See https://github.com/Automattic/vip-block-data-api/pull/67. Currently, when there is no default value available for a block attribute, that attribute is not represented in the block's attribute output.

This PR primarily adds tests to define this behavior as expected, and put it under unit testing.

Steps to Test

  1. Check out PR.
  2. Run wp-env start
  3. Run composer install.
  4. Run composer run test
  5. Verify tests pass.