Overview
#3501290: Introduce unit test coverage for both ComponentSource plugins (Block + SDC) added ComponentSourceTestBase with only 3 mandatory test methods:
::testDiscovery()::testGetReferencedPluginClass()(which@dependson the first one)::testRenderComponentLive()(which@dependson 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.
Issue fork experience_builder-3518832
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 #2
wim leersComment #3
wim leersSibling: #3518838: ComponentSource robustness: add `ComponentSourceTestBase::testSettings()`.
Comment #4
wim leersSibling: #3518838: ComponentSource robustness: add `ComponentSourceTestBase::testSettings()`.
Comment #5
wim leersSibling: #3518838: ComponentSource robustness: add `ComponentSourceTestBase::testSettings()`.
Comment #6
wim leersComment #7
danielvezaComment #8
wim leers@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!
Comment #9
isholgueras commentedI'm going to start working on this.
Comment #11
isholgueras commentedComment #12
wim leersGreat start!
Comment #13
isholgueras commentedComment #14
wim leersOn it!
Just cross-posted actually 😄 This will also make #3516705: Auto-saved changes to code components are not visible in preview-on-hover-component-list until published easier 👍
Comment #15
wim leersWhile 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.
🏓
Comment #16
isholgueras commentedComment #17
wim leersThis 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! 😄
Comment #18
wim leersComment #20
wim leersThis unblocked #3516705: Auto-saved changes to code components are not visible in preview-on-hover-component-list until published 🥳