Problem/Motivation

Because of #3083275: [meta] Update tests that rely on Classy to not rely on it anymore and Classy being deprecated in Drupal 9 + removed in Drupal 10,: Tests that aren't specifically testing Classy yet declare $defaultTheme = 'classy'; should be refactored to use Stark as the default theme instead.

Proposed resolution

Change all tests in this module to use Stark as the default theme, and refactor the tests where needed so they continue to function properly.

Usually we do one module at a time, but these modules are closely related and have relatively little dependence on classy.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

CommentFileSizeAuthor
#2 3269517-2.patch11.79 KBdanflanagan8

Comments

danflanagan8 created an issue. See original summary.

danflanagan8’s picture

Assigned: danflanagan8 » Unassigned
Status: Active » Needs review
StatusFileSize
new11.79 KB

The necessary changes in datetime and datetime_range are very similar. Mostly removing class="datetime" from a number of assertions.

danflanagan8’s picture

Priority: Normal » Major
Issue tags: +Drupal 10

Updating priority to Major just like @xjm did for #3248295: Taxonomy tests should not rely on Classy and adding D10 tag.

dww’s picture

Status: Needs review » Reviewed & tested by the community

Before

% egrep -ir classy core/modules/datetime*/tests
core/modules/datetime/tests/src/Functional/DateTimeFieldTest.php:  protected $defaultTheme = 'classy';
core/modules/datetime/tests/src/Functional/Views/FilterDateTest.php:  protected $defaultTheme = 'classy';
core/modules/datetime_range/tests/src/Functional/DateRangeFieldTest.php:  protected $defaultTheme = 'classy';

After

% egrep -ir classy core/modules/datetime*/tests
%

Review

Patch looks great:

  1. +++ b/core/modules/datetime/tests/src/Functional/DateTimeFieldTest.php
    @@ -127,7 +127,7 @@ public function testDateField() {
    +              $expected_markup = '<time datetime="' . $expected_iso . '">' . $expected . '</time>';
    

    Almost every change of substance in this patch is like this. We simply remove class="datetime" from what we're expecting. But everything is already targeting a <time> with the expected datetime attribute, so we don't also need the class for anything.

  2. +++ b/core/modules/datetime/tests/src/Functional/Views/FilterDateTest.php
    @@ -142,13 +142,13 @@ public function testExposedGroupedFilters() {
    +    $results = $this->cssSelect('.views-row .field-content');
    

    This is the only other type of change. Seems like a perfectly acceptable step sidewise in specificity.

Resolution

Whereas:

  1. No "classy" in any datetime* tests remaining.
  2. Testbot is happy.
  3. Nothing to complain about in the patch.

Therefore be it resolved: RTBC. 😉

Thanks yet again @danflanagan8!

  • catch committed 576a49b on 10.0.x
    Issue #3269517 by danflanagan8, dww: Datetime and Datetime Range tests...
catch’s picture

Status: Reviewed & tested by the community » Fixed

Committed/pushed to 10.0.x and cherry-picked to 9.4.x, thanks!

  • catch committed aa3e4ae on 9.4.x
    Issue #3269517 by danflanagan8, dww: Datetime and Datetime Range tests...

Status: Fixed » Closed (fixed)

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