Overview

#3501290: Introduce unit test coverage for both ComponentSource plugins (Block + SDC) added ComponentSourceTestBase with only 3 mandatory test methods:

  1. ::testDiscovery()
  2. ::testGetReferencedPluginClass() (which @depends on the first one)
  3. ::testRenderComponentLive() (which @depends on the first one)

The base test class was used for testing both the sdc and block ComponentSource plugins.

But the block's test coverage has one more: BlockComponentTest::testGetClientSideInfo().

Proposed resolution

Move this to the base test class and implement it for SDCs, too.

User interface changes

None.

Command icon 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

wim leers created an issue. See original summary.

wim leers’s picture

Title: Expand `::getClientSideInfo()` test to all ComponentSource plugins » ComponentSource robustness: add `ComponentSourceTestBase::testGetClientSideInfo()`
wim leers’s picture

wim leers’s picture

wim leers’s picture

Issue summary: View changes
danielveza’s picture

Assigned: Unassigned » danielveza
wim leers’s picture

@danielveza: How is this going? Are you still actively working on this? #3518838: ComponentSource robustness: add `ComponentSourceTestBase::testSettings()` is in, this is the next step!

isholgueras’s picture

Assigned: danielveza » isholgueras

I'm going to start working on this.

isholgueras’s picture

Assigned: isholgueras » wim leers
Status: Active » Needs review
wim leers’s picture

Assigned: wim leers » isholgueras
Status: Needs review » Needs work

Great start!

isholgueras’s picture

Assigned: isholgueras » wim leers
Status: Needs work » Needs review
wim leers’s picture

Issue tags: +blocker
wim leers’s picture

Assigned: wim leers » isholgueras
Status: Needs review » Needs work

While the tests are passing, I think they're still missing some of the clarity I'm looking for to build enough confidence and allow these tests to be efficiently updated+expanded in the future.

🏓

isholgueras’s picture

Assigned: isholgueras » wim leers
Status: Needs work » Needs review
wim leers’s picture

Assigned: wim leers » Unassigned
Status: Needs review » Reviewed & tested by the community
Parent issue: » #3520484: [META] Production-ready ComponentSource plugins

This was 95% ready! 👏

I just had to do some minor refactoring to achieve the test simplicity+robustness I was looking for.

In doing so, I discovered a bug, which is exactly why I was insisting for that test simplicity — I didn't spot the bug during review either, it's only thanks to the refactor to simplify the test logic itself that this bug was revealed! 😄

wim leers’s picture

Status: Reviewed & tested by the community » Fixed

wim leers’s picture

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.