Closed (fixed)
Project:
Drupal core
Version:
9.4.x-dev
Component:
comment.module
Priority:
Normal
Category:
Task
Assigned:
Reporter:
Created:
3 Mar 2022 at 20:56 UTC
Updated:
22 Mar 2022 at 14:09 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
danflanagan8I'm running into an interesting situation with
Drupal\Tests\comment\Functional\CommentCSSTestwhich is set to use Classy. In fact, this class really is focussed on testing Classy itself. So those assertions should be moved somewhere presumably. I forget (or maybe never knew) the plan for handling situations like this. Perhaps this is a situation where we need to change to the Starterkit theme instead of Stark? I guess that's probably it.I've also noticed that the
by-viewerclass is completely untested in core. Maybe that could be done too.Comment #3
danflanagan8Here's a patch!
Regarding my comments in #2 which were really hastily scribbled...
> Perhaps this is a situation where we need to change to the Starterkit theme instead of Stark?
I left a @todo for that.
> I've also noticed that the by-viewer class is completely untested in core. Maybe that could be done too.
Way out of scope obviously so I didn't take any action on this.
Comment #4
danflanagan8I think I had a cs violation on that one anyway. Updated patch here.
Comment #5
mglamanDo we have this messaging formalized anywhere?
I don't know how often it'll be needed, but seems like something to have on https://www.drupal.org/project/drupal/issues/3083275 and also track occurrences it was used.
This looks like an addition to the test which didn't exist before.
While +1 on fixing the test, I'm not sure if this is in scope of the issue (drop using Classy.)
Comment #6
danflanagan8Thanks, @mglaman!
It is indeed an addition, but I believe it is necessary in order to allow the change in
CommentThreadingTest::assertNoParentLink()Without classy there's no
parentclass and the "In reply to" text was the only reasonable thing I could see to key off of for testing the non-existence of a parent. But asserting that this text is NOT there is only useful if we also assert the text IS there in the "sister" functionCommentThreadingTest::assertParentLink(). That's the code I added that looks out of scope. But I think we need it.These two functions (assertParentLink/assertNoParentLink) are called out in this old issue for being really weird: #1847540: [META] Clean up comment module tests and decouple from node
No, and I like your idea of getting something formalized. I'll post over there.
Comment #7
mglamanThanks @danflanagan8. +1 from me then. I don't think it's RTBC ready until we resolve wording for the "Needs CSS classes in tests, use starterkit" @todo
Comment #8
danflanagan8Cool! I'm going to set it back to NW since we still need to update the @todo whenever we settle on language.
Comment #9
danflanagan8Here's a patch with the updated @todo.
It follows the pattern proposed by @xjm in the parent issue: #3083275-25: [meta] Update tests that rely on Classy to not rely on it anymore
I created a followup that is referenced in the updated @todo: #3267890: Update CommentCSSTest to use starterkit
Ready for review again!
Comment #10
mglamanGoing to RTBC. We've got the standardized @todo messaging when we have to remain on classy and the follow up created.
Comment #13
lauriii+1 for skipping this one.
Committed 089cd0b and pushed to 10.0.x. Also cherry-picked to 9.4.x. Thanks!