Overview
Looking at #3488368: Also convert metadata (page data) fields in ClientDataToEntityConverter where we will be updating ClientDataToEntityConverter and needing to add more tests
I realized that we have logic in ApiContentUpdateForDemoControllerTest that really tests, ClientDataToEntityConverter and ClientServerConversionTrait. We will need to change these test cases in #3488368
I had mentioned in #3489994-16: Create an endpoint to publish all auto-saved entities that would move the tests coverage out of ApiContentUpdateForDemoControllerTest because this a temporary class needed for demo logic.
In #3488368: Also convert metadata (page data) fields in ClientDataToEntityConverter I would really like to not update ApiContentUpdateForDemoControllerTest more metadata test cases.
Proposed resolution
Move test cases out of ApiContentUpdateForDemoControllerTest and into their own tests of ClientDataToEntityConverter and ClientServerConversionTrait
User interface changes
None
Issue fork experience_builder-3494273
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
tedbowComment #4
wim leersComment #5
wim leersComment #6
tedbowComment #7
tedbowAsking for @wim leers review again. The test cases are being moved to
\Drupal\Tests\experience_builder\Kernel\ClientServerConversionTraitTest::testConvertClientToServerErrors\Drupal\Tests\experience_builder\Kernel\ClientDataToEntityConverterTest::testConvertif the errors are not caught in\Drupal\experience_builder\Controller\ClientServerConversionTrait::convertClientToServerbut only caught in\Drupal\experience_builder\ClientDataToEntityConverter::convert\Drupal\Tests\experience_builder\Functional\ApiContentUpdateForDemoControllerTest::testSaveis still left with test cases that prove that if the call to$violations = $this->clientDataToEntityConverter->convert(json_decode($request->getContent(), TRUE), $entity);gets an error entity will not be saved
Comment #8
wim leersI'd love to see @larowlan approve this too, or suggest an alternative 🤞
Comment #9
larowlanI think this controller is temporary code so this unblocks more work
Comment #11
wim leersComment #12
tedbowThanks @wim leers and @larowlan!