Verified Commit f56cd047 authored by Alex Pott's avatar Alex Pott
Browse files

Issue #3274265 by Johnny Santos, danflanagan8: Locale Tests should not rely on Classy

(cherry picked from commit 5c6d0236)
parent 4da04a22
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -2,9 +2,9 @@ langcode: en
status: true
dependencies:
  theme:
    - classy
    - stark
id: test_default_config
theme: classy
theme: stark
region: content
weight: -40
provider: null
+6 −6
Original line number Diff line number Diff line
@@ -24,7 +24,7 @@ class LocaleContentTest extends BrowserTestBase {
  /**
   * {@inheritdoc}
   */
  protected $defaultTheme = 'classy';
  protected $defaultTheme = 'stark';

  /**
   * Verifies that machine name fields are always LTR.
@@ -214,25 +214,25 @@ public function testContentTypeDirLang() {

    // Check if English node does not have lang tag.
    $this->drupalGet('node/' . $nodes['en']->id());
    $element = $this->cssSelect('article.node[lang="en"]');
    $element = $this->cssSelect('article[lang="en"]');
    $this->assertEmpty($element, 'The lang tag has not been assigned to the English node.');

    // Check if English node does not have dir tag.
    $element = $this->cssSelect('article.node[dir="ltr"]');
    $element = $this->cssSelect('article[dir="ltr"]');
    $this->assertEmpty($element, 'The dir tag has not been assigned to the English node.');

    // Check if Arabic node has lang="ar" & dir="rtl" tags.
    $this->drupalGet('node/' . $nodes['ar']->id());
    $element = $this->cssSelect('article.node[lang="ar"][dir="rtl"]');
    $element = $this->cssSelect('article[lang="ar"][dir="rtl"]');
    $this->assertNotEmpty($element, 'The lang and dir tags have been assigned correctly to the Arabic node.');

    // Check if Spanish node has lang="es" tag.
    $this->drupalGet('node/' . $nodes['es']->id());
    $element = $this->cssSelect('article.node[lang="es"]');
    $element = $this->cssSelect('article[lang="es"]');
    $this->assertNotEmpty($element, 'The lang tag has been assigned correctly to the Spanish node.');

    // Check if Spanish node does not have dir="ltr" tag.
    $element = $this->cssSelect('article.node[lang="es"][dir="ltr"]');
    $element = $this->cssSelect('article[lang="es"][dir="ltr"]');
    $this->assertEmpty($element, 'The dir tag has not been assigned to the Spanish node.');
  }

+2 −2
Original line number Diff line number Diff line
@@ -25,7 +25,7 @@ class LocaleTranslatedSchemaDefinitionTest extends BrowserTestBase {
  /**
   * {@inheritdoc}
   */
  protected $defaultTheme = 'classy';
  protected $defaultTheme = 'stark';

  /**
   * {@inheritdoc}
@@ -95,7 +95,7 @@ public function testTranslatedUpdate() {
    // markup and a link instead of specific text because text may be
    // translated.
    $this->drupalGet($update_url . '/selection', ['external' => TRUE]);
    $this->assertSession()->responseContains('messages--status');
    $this->assertSession()->statusMessageExists('status');
    $this->assertSession()->linkByHrefNotExists('fr/update.php/run', 'No link to run updates.');
  }

+2 −2
Original line number Diff line number Diff line
@@ -88,7 +88,7 @@ public function testGetDefaultConfigLangcode() {

    $block = Block::create([
      'id' => 'test_default_config',
      'theme' => 'classy',
      'theme' => 'stark',
      'status' => TRUE,
      'region' => 'content',
      'plugin' => 'local_tasks_block',
@@ -105,7 +105,7 @@ public function testGetDefaultConfigLangcode() {

    // Install the theme after creating the block as installing the theme will
    // install the block provided by the locale_test module.
    \Drupal::service('theme_installer')->install(['classy']);
    \Drupal::service('theme_installer')->install(['stark']);

    // The test_default_config block provided by the locale_test module will not
    // be installed because a block with the same ID already exists.