Commit 91947b29 authored by catch's avatar catch
Browse files

Issue #3259928 by tstoeckler, Berdir, m4olivei, marcoscano, Gábor Hojtsy:...

Issue #3259928 by tstoeckler, Berdir, m4olivei, marcoscano, Gábor Hojtsy: Change various tests that test with "all themes" to also include Olivero

(cherry picked from commit c40c2c9f)
parent 65c3e57f
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -46,6 +46,7 @@ public function testBlockDemo() {
    $available_themes = [
      'bartik',
      'classy',
      'olivero',
      'seven',
      'stark',
    ];
+8 −2
Original line number Diff line number Diff line
@@ -269,9 +269,15 @@ public function testBlock() {
   */
  public function testBlockThemeSelector() {
    // Install all themes.
    \Drupal::service('theme_installer')->install(['bartik', 'seven', 'stark']);
    $themes = [
      'bartik',
      'olivero',
      'seven',
      'stark',
    ];
    \Drupal::service('theme_installer')->install($themes);
    $theme_settings = $this->config('system.theme');
    foreach (['bartik', 'seven', 'stark'] as $theme) {
    foreach ($themes as $theme) {
      $this->drupalGet('admin/structure/block/list/' . $theme);
      $this->assertSession()->titleEquals('Block layout | Drupal');
      // Select the 'Powered by Drupal' block to be placed.
+4 −3
Original line number Diff line number Diff line
@@ -204,15 +204,16 @@ public function testsBlockContentAddTypes() {
      ->getStorage('block_content');

    // Install all themes.
    \Drupal::service('theme_installer')->install(['bartik', 'seven', 'stark']);
    $themes = ['bartik', 'olivero', 'seven', 'stark'];
    \Drupal::service('theme_installer')->install($themes);
    $theme_settings = $this->config('system.theme');
    foreach (['bartik', 'seven', 'stark'] as $default_theme) {
    foreach ($themes as $default_theme) {
      // Change the default theme.
      $theme_settings->set('default', $default_theme)->save();
      $this->drupalPlaceBlock('local_actions_block');

      // For each installed theme, go to its block page and test the redirects.
      foreach (['bartik', 'seven', 'stark'] as $theme) {
      foreach ($themes as $theme) {
        // Test that adding a block from the 'place blocks' form sends you to the
        // block configure form.
        $path = $theme == $default_theme ? 'admin/structure/block' : "admin/structure/block/list/$theme";
+11 −5
Original line number Diff line number Diff line
@@ -44,6 +44,16 @@ protected function setUp(): void {

  }

  /**
   * {@inheritdoc}
   */
  protected function getTestThemes() {
    // Make sure to test with Olivero first to avoid
    // https://www.drupal.org/project/quickedit/issues/3262273
    // @todo Remove when that is fixed.
    return array_merge(['olivero'], array_diff(parent::getTestThemes(), ['olivero']));
  }

  /**
   * Tests QuickEdit links behavior.
   */
@@ -78,11 +88,7 @@ public function testQuickEditLinks() {

      $this->enableTheme($theme);

      $block = $this->placeBlock($block_plugin, [
        // @todo Remove this when
        //   https://www.drupal.org/project/drupal/issues/3257504 is fixed.
        'region' => 'sidebar_first',
      ]);
      $block = $this->placeBlock($block_plugin);
      $block_selector = $this->getBlockSelector($block);
      // Load the same page twice.
      foreach ([1, 2] as $page_load_times) {
+2 −6
Original line number Diff line number Diff line
@@ -190,7 +190,7 @@ public function getBlockTests() {
          'theme' => $theme,
          'block_plugin' => 'search_form_block',
          'new_page_text' => NULL,
          'element_selector' => '#edit-submit',
          'element_selector' => '[data-drupal-selector="edit-submit"]',
          'label_selector' => 'h2',
          'button_text' => 'Save Search form',
          'toolbar_item' => NULL,
@@ -232,11 +232,7 @@ public function getBlockTests() {
  public function testEditModeEnableDisable() {
    foreach ($this->getTestThemes() as $theme) {
      $this->enableTheme($theme);
      $block = $this->placeBlock('system_powered_by_block', [
        // @todo Remove this when
        //   https://www.drupal.org/project/drupal/issues/3257504 is fixed.
        'region' => 'sidebar_first',
      ]);
      $block = $this->placeBlock('system_powered_by_block');
      foreach (['contextual_link', 'toolbar_link'] as $enable_option) {
        $this->drupalGet('user');
        $this->assertEditModeDisabled();
Loading