Use $defaultTheme for using views_test_classy_subtheme in Drupal\Tests\views_ui\FunctionalJavascript\DisplayTest::testAjaxRebuild() as requested by @larowlan on #3067386-31: AJAX rebuild of Views UI form re-renders parts of the form without using Form API, so additional hooks are needed in lieu of hook_form_view_edit_form_alter():

+++ b/core/modules/views_ui/tests/src/FunctionalJavascript/DisplayTest.php
@@ -122,4 +122,29 @@ protected function toggleContextualTriggerVisibility($selector) {
+  public function testAjaxRebuild() {
+    \Drupal::service('theme_installer')->install(['views_test_classy_subtheme']);
+
+    $this->config('system.theme')
+      ->set('default', 'views_test_classy_subtheme')
+      ->save();

now we have support for setting the default theme via a test-class property, should we split this into its own class and make use of that property?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

lauriii created an issue. See original summary.

tim.plunkett’s picture

Status: Active » Needs review
FileSize
3.53 KB

Didn't know about this property, that's nice!

Lendude’s picture

Looks good, one question:

+++ b/core/modules/views_ui/tests/src/FunctionalJavascript/AdminAjaxTest.php
@@ -0,0 +1,56 @@
+    $this->drupalGet('admin/structure/views/view/user_admin_people');

+++ b/core/modules/views_ui/tests/src/FunctionalJavascript/DisplayTest.php
@@ -122,29 +122,4 @@ protected function toggleContextualTriggerVisibility($selector) {
-    $this->drupalGet('admin/structure/views/view/content');

Any reason for the change from content to people?

Version: 8.9.x-dev » 9.1.x-dev

Drupal 8.9.0-beta1 was released on March 20, 2020. 8.9.x is the final, long-term support (LTS) minor release of Drupal 8, which means new developments and disruptive changes should now be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 9.1.x-dev » 9.2.x-dev

Drupal 9.1.0-alpha1 will be released the week of October 19, 2020, which means new developments and disruptive changes should now be targeted for the 9.2.x-dev branch. For more information see the Drupal 9 minor version schedule and the Allowed changes during the Drupal 9 release cycle.

Version: 9.2.x-dev » 9.3.x-dev

Drupal 9.2.0-alpha1 will be released the week of May 3, 2021, which means new developments and disruptive changes should now be targeted for the 9.3.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.0-rc1 was released on November 26, 2021, which means new developments and disruptive changes should now be targeted for the 9.4.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

tim.plunkett’s picture

The change is needed because the other test had other views installed that aren't on by default.

Rerolled due to stale context

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.0-alpha1 was released on May 6, 2022, which means new developments and disruptive changes should now be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

smustgrave’s picture

Status: Needs review » Reviewed & tested by the community

Looks good to me looking at the patch. Verified it still applies on 9.5 too

alexpott’s picture

Version: 9.5.x-dev » 9.4.x-dev
Status: Reviewed & tested by the community » Fixed

Committed and pushed 3388371b4c to 10.1.x and 6c3f82219e to 10.0.x and a9edcb0db4 to 9.5.x and 86d33bd032 to 9.4.x. Thanks!

Backported to 9.4.x because this is a test only change and keeping tests aligned is helpful.

  • alexpott committed 3388371 on 10.1.x
    Issue #3088234 by tim.plunkett: Use $defaultTheme for using...

  • alexpott committed 6c3f822 on 10.0.x
    Issue #3088234 by tim.plunkett: Use $defaultTheme for using...

  • alexpott committed a9edcb0 on 9.5.x
    Issue #3088234 by tim.plunkett: Use $defaultTheme for using...

  • alexpott committed 86d33bd on 9.4.x
    Issue #3088234 by tim.plunkett: Use $defaultTheme for using...

Status: Fixed » Closed (fixed)

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