Verified Commit 22c29ded authored by Alex Pott's avatar Alex Pott
Browse files

Issue #3272558 by danflanagan8: Content Translation tests should not rely on Classy

parent 446bc5dd
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -55,7 +55,7 @@ public function testDisableSetting() {
    ];
    $this->submitForm($edit, 'Save configuration');

    $assert->pageTextContains('Settings successfully updated.');
    $assert->statusMessageContains('Settings successfully updated.', 'status');

    $assert->checkboxChecked($group_checkbox);

@@ -66,7 +66,7 @@ public function testDisableSetting() {
    ];
    $this->submitForm($edit, 'Save configuration');

    $assert->pageTextContains('Settings successfully updated.');
    $assert->statusMessageContains('Settings successfully updated.', 'status');

    $assert->checkboxNotChecked($group_checkbox);
  }
+2 −2
Original line number Diff line number Diff line
@@ -36,8 +36,8 @@ public function testEnable() {
    $this->submitForm($edit, 'Install');

    // Status messages are shown.
    $this->assertSession()->pageTextContains('This site has only a single language enabled. Add at least one more language in order to translate content.');
    $this->assertSession()->pageTextContains('Enable translation for content types, taxonomy vocabularies, accounts, or any other element you wish to translate.');
    $this->assertSession()->statusMessageContains('This site has only a single language enabled. Add at least one more language in order to translate content.', 'warning');
    $this->assertSession()->statusMessageContains('Enable translation for content types, taxonomy vocabularies, accounts, or any other element you wish to translate.', 'warning');

    // No pending updates should be available.
    $this->drupalGet('admin/reports/status');
+2 −2
Original line number Diff line number Diff line
@@ -90,7 +90,7 @@ public function doTestOverview($index) {
    $it_delete_href = $it_delete_url->toString();
    $this->assertSession()->linkByHrefNotExists($it_delete_href);
    $warning = 'The "Delete translation" action is only available for published translations.';
    $this->assertSession()->pageTextContains($warning);
    $this->assertSession()->statusMessageContains($warning, 'warning');
    $this->drupalGet($this->getEditUrl($it_revision));
    $this->assertSession()->buttonNotExists('Delete translation');

@@ -106,7 +106,7 @@ public function doTestOverview($index) {
    $this->assertTrue($it_revision->hasTranslation('it'));
    $this->drupalGet($overview_url);
    $this->assertSession()->linkByHrefExists($it_delete_href);
    $this->assertSession()->pageTextNotContains($warning);
    $this->assertSession()->statusMessageNotContains($warning);
    $this->drupalGet($this->getEditUrl($it_revision));
    $this->assertSession()->buttonExists('Delete translation');

+4 −5
Original line number Diff line number Diff line
@@ -37,7 +37,7 @@ class ContentTranslationSettingsTest extends BrowserTestBase {
  /**
   * {@inheritdoc}
   */
  protected $defaultTheme = 'classy';
  protected $defaultTheme = 'stark';

  protected function setUp(): void {
    parent::setUp();
@@ -98,8 +98,7 @@ public function testSettingsUI() {
      'settings[comment][comment_article][fields][uid]' => FALSE,
    ];
    $this->assertSettings('comment', 'comment_article', FALSE, $edit);
    $xpath_err = '//div[contains(@class, "error")]';
    $this->assertNotEmpty($this->xpath($xpath_err), 'Enabling translation only for entity bundles generates a form error.');
    $this->assertSession()->statusMessageContains('At least one field needs to be translatable to enable Comment_article for translation.', 'error');

    // Test that the translation settings are not stored if a non-configurable
    // language is set as default and the language selector is hidden.
@@ -111,7 +110,7 @@ public function testSettingsUI() {
      'settings[comment][comment_article][fields][comment_body]' => TRUE,
    ];
    $this->assertSettings('comment', 'comment_article', FALSE, $edit);
    $this->assertNotEmpty($this->xpath($xpath_err), 'Enabling translation with a fixed non-configurable language generates a form error.');
    $this->assertSession()->statusMessageContains('Translation is not supported if language is always one of: Not specified, Not applicable', 'error');

    // Test that a field shared among different bundles can be enabled without
    // needing to make all the related bundles translatable.
@@ -245,7 +244,7 @@ public function testAccountLanguageSettingsUI() {
    $this->drupalGet('admin/config/people/accounts');
    $this->submitForm(['anonymous' => 'Save me please!'], 'Save configuration');
    $this->assertSession()->fieldValueEquals('anonymous', 'Save me please!');
    $this->assertSession()->pageTextContains('The configuration options have been saved.');
    $this->assertSession()->statusMessageContains('The configuration options have been saved.', 'status');
  }

  /**
+1 −1
Original line number Diff line number Diff line
@@ -123,7 +123,7 @@ public function testImageFieldSync() {
    ];
    $this->drupalGet('admin/config/regional/content-language');
    $this->submitForm($edit, 'Save configuration');
    $this->assertSession()->elementNotExists('xpath', '//div[contains(@class, "messages--error")]');
    $this->assertSession()->statusMessageNotExists('error');
    $this->assertSession()->checkboxChecked('edit-settings-entity-test-mul-entity-test-mul-columns-field-test-et-ui-image-alt');
    $this->assertSession()->checkboxChecked('edit-settings-entity-test-mul-entity-test-mul-columns-field-test-et-ui-image-title');
    $this->drupalLogin($this->translator);
Loading