Missing e2e for Publish button hides bugs

Created on 8 January 2025, 2 months ago

Overview

We added ✨ Connect the "Publish" button with the entity update controller Active we didn't add test probably because this button is temporary. Until we have the "Publish All" button that is being worked on various issues

But this is our only really way to test actual saving from the front-end. Therefore for front-end to back end entity conversion we don't have full test coverage.

Although the "Publish" button is temporary until ✨ [PP-1] Implement the "Publish All" button Postponed . We changed ApiContentUpdateForDemoController in πŸ“Œ Change ApiContentUpdateForDemoController to save from auto-save instead of request data Active to work the same way that ApiPublishAllController. Therefore it would probably find a lot of the same bugs as the final "Publish all" button would hit.

a couple of example of bugs found in manual testing

  • We have ClientDataToEntityConverterTest but we just make up what we think front-end data will be. for instance πŸ“Œ [PP-1] Send page data to Drupal for storage in auto-save store Postponed: needs info changes this test and it passes but when I actually test the functionality with the Publish button it errors out with violations such as
    1. The current user is not allowed to update the field 'changed'.
    2. Field field_image_0_upload_button is unknown.

    If we already had a e2e test for the "Publish" button presumably it would have just started to fail rather than only being able to find this via manual testing or completely missing it

  • Using "Publish" button when Drupalicon component is placed. gets

    AssertionError: assert(str_starts_with($value, '{')) in assert() (line 66 of /Users/ted.bowman/sites/exp-d-core/modules/contrib/experience_builder/src/Plugin/DataType/ComponentPropsValues.php).

    #0 /Users/ted.bowman/sites/exp-d-core/modules/contrib/experience_builder/src/Plugin/DataType/ComponentPropsValues.php(66): assert(false, 'assert(str_star...')
    #1 /Users/ted.bowman/sites/exp-d-core/core/lib/Drupal/Core/Field/FieldItemBase.php(139): Drupal\experience_builder\Plugin\DataType\ComponentPropsValues->setValue('[]', false)
    #2 /Users/ted.bowman/sites/exp-d-core/core/lib/Drupal/Core/TypedData/Plugin/DataType/Map.php(134): Drupal\Core\Field\FieldItemBase->writePropertyValue('props', '[]')
    #3 /Users/ted.bowman/sites/exp-d-core/modules/contrib/experience_builder/src/Plugin/Field/FieldType/ComponentTreeItem.php(225): Drupal\Core\TypedData\Plugin\DataType\Map->set('props', '[]', false)
    #4 /Users/ted.bowman/sites/exp-d-core/modules/contrib/experience_builder/src/ClientDataToEntityConverter.php(36): Drupal\experience_builder\Plugin\Field\FieldType\ComponentTreeItem->setValue(Array)
    #5 /Users/ted.bowman/sites/exp-d-core/modules/contrib/experience_builder/src/Controller/ApiContentUpdateForDemoController.php(36): Drupal\experience_builder\ClientDataToEntityConverter->convert(Array, Object(Drupal\node\Entity\Node))
    #6 [internal function]: Drupal\experience_builder\Controller\ApiContentUpdateForDemoController->__invoke(Object(Drupal\node\Entity\Node))
    #7 /Users/ted.bowman/sites/exp-d-core/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array(Object(Drupal\experience_builder\Controller\ApiContentUpdateForDemoController), Array)
    #8 /Users/ted.bowman/sites/exp-d-core/core/lib/Drupal/Core/Render/Renderer.php(593): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
    #9 /Users/ted.bowman/sites/exp-d-core/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(121): Drupal\Core\Render\Renderer->executeInRenderContext(Object(Drupal\Core\Render\RenderContext), Object(Closure))
    #10 /Users/ted.bowman/sites/exp-d-core/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(97): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Object(Drupal\experience_builder\Controller\ApiContentUpdateForDemoController), Array)

Proposed resolution

Create a very basic test for "Publish" button that adds 1 component, and updates the node title(this would not save until πŸ“Œ [PP-1] Send page data to Drupal for storage in auto-save store Postponed: needs info but we have make it does not break saving

User interface changes

πŸ“Œ Task
Status

Active

Version

0.0

Component

Page builder

Created by

πŸ‡ΊπŸ‡ΈUnited States tedbow Ithaca, NY, USA

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024