Closed (fixed)
Project:
Drupal core
Version:
9.4.x-dev
Component:
block.module
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
24 Mar 2022 at 17:49 UTC
Updated:
9 May 2022 at 16:14 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
danflanagan8This is a fairly big one. But to the extent that any of these issues are exciting, this one is exciting to me. That's because it's the first one where I get to use the brand new status message assertions! #3268932: Add methods to assert status messages to WebAssert
So that's one thing you'll see here. I refactored to use those status message assertions where possible. I think only one of them NEEDED to be refactored, but the new assertions are more readable while being slightly more robust so it's an easy win.
Other changes are fairly typical of these Classy-to-Stark issues, like selecting block elements using the id instead of a class.
Comment #3
danflanagan8Something that is new to this Classy-to-Stark issue is that there were lots of selectors for block regions. In one instance I made a little map of the corresponding selectors. This is basically the mapping I used anywhere I had to make changes to selectors for regions.
Here's another bit of code I wanted to call out.
Obviously I'm changing
HighlightedtoHeaderhere. But the "Highlighted" region does not appear to be special in any way. So I changed to a region that is easier to select with stark.Comment #4
danflanagan8try that again
Comment #5
danflanagan8Updating priority to Major just like @xjm did for #3248295: Taxonomy tests should not rely on Classy and adding D10 tag.
Comment #6
nod_we could look for the image src too? That would be similar to the next selector that looks for a specific text content.
Haven't tried it in the test itself but a xpath selector to select a text node could be
nice one :)
Comment #7
nod_actually probably doesn't need a NW, just some small comments
Comment #8
danflanagan8Thanks for the review @nod_!
Here's a patch with 6.1 and 6.2 addressed. Thanks for the xpath selector in 6.2. That's pretty slick.
And thanks for 6.3. That's actually a case I included in the CR for the brand new methods for asserting status messages: https://www.drupal.org/node/3270424
I also noticed that I had removed a reference to classy in
BlockDemoTest::testBlockDemothat I should not have removed. I have added it back. That is literally test coverage for classy and it needs to remain as long as classy is in core.Comment #9
danflanagan8Of course I forgot the patch...
Comment #11
danflanagan8Oops. I guess I outsmarted myself. We do indeed need to remove classy from the list of themes in
BlockDemoTest::testBlockDemo. Classy does not have a block demo page because it is marked as "hidden", thus the 404. Previously it was getting removed from the array of themes automatically since it was the default theme. So I'm re-removing classy.Comment #12
nod_All good for me, thanks
Comment #13
alexpottCommitted and pushed f88b4a9a8a to 10.0.x and 1876f3f5b1 to 9.4.x. Thanks!