You are here

public function LingotekSettingsTabContentFormTest::testWhenDisabledAndEnabledBackNodeArticleFieldsAreKept in Lingotek Translation 3.2.x

Same name and namespace in other branches
  1. 8.2 tests/src/FunctionalJavascript/LingotekSettingsTabContentFormTest.php \Drupal\Tests\lingotek\FunctionalJavascript\LingotekSettingsTabContentFormTest::testWhenDisabledAndEnabledBackNodeArticleFieldsAreKept()
  2. 4.0.x tests/src/FunctionalJavascript/LingotekSettingsTabContentFormTest.php \Drupal\Tests\lingotek\FunctionalJavascript\LingotekSettingsTabContentFormTest::testWhenDisabledAndEnabledBackNodeArticleFieldsAreKept()
  3. 3.0.x tests/src/FunctionalJavascript/LingotekSettingsTabContentFormTest.php \Drupal\Tests\lingotek\FunctionalJavascript\LingotekSettingsTabContentFormTest::testWhenDisabledAndEnabledBackNodeArticleFieldsAreKept()
  4. 3.1.x tests/src/FunctionalJavascript/LingotekSettingsTabContentFormTest.php \Drupal\Tests\lingotek\FunctionalJavascript\LingotekSettingsTabContentFormTest::testWhenDisabledAndEnabledBackNodeArticleFieldsAreKept()
  5. 3.3.x tests/src/FunctionalJavascript/LingotekSettingsTabContentFormTest.php \Drupal\Tests\lingotek\FunctionalJavascript\LingotekSettingsTabContentFormTest::testWhenDisabledAndEnabledBackNodeArticleFieldsAreKept()
  6. 3.4.x tests/src/FunctionalJavascript/LingotekSettingsTabContentFormTest.php \Drupal\Tests\lingotek\FunctionalJavascript\LingotekSettingsTabContentFormTest::testWhenDisabledAndEnabledBackNodeArticleFieldsAreKept()
  7. 3.5.x tests/src/FunctionalJavascript/LingotekSettingsTabContentFormTest.php \Drupal\Tests\lingotek\FunctionalJavascript\LingotekSettingsTabContentFormTest::testWhenDisabledAndEnabledBackNodeArticleFieldsAreKept()
  8. 3.6.x tests/src/FunctionalJavascript/LingotekSettingsTabContentFormTest.php \Drupal\Tests\lingotek\FunctionalJavascript\LingotekSettingsTabContentFormTest::testWhenDisabledAndEnabledBackNodeArticleFieldsAreKept()
  9. 3.7.x tests/src/FunctionalJavascript/LingotekSettingsTabContentFormTest.php \Drupal\Tests\lingotek\FunctionalJavascript\LingotekSettingsTabContentFormTest::testWhenDisabledAndEnabledBackNodeArticleFieldsAreKept()
  10. 3.8.x tests/src/FunctionalJavascript/LingotekSettingsTabContentFormTest.php \Drupal\Tests\lingotek\FunctionalJavascript\LingotekSettingsTabContentFormTest::testWhenDisabledAndEnabledBackNodeArticleFieldsAreKept()

File

tests/src/FunctionalJavascript/LingotekSettingsTabContentFormTest.php, line 105

Class

LingotekSettingsTabContentFormTest
@group lingotek

Namespace

Drupal\Tests\lingotek\FunctionalJavascript

Code

public function testWhenDisabledAndEnabledBackNodeArticleFieldsAreKept() {
  $this
    ->saveLingotekContentTranslationSettings([
    'node' => [
      'article' => [
        'profiles' => 'manual',
        'fields' => [
          'title' => 1,
          'uid' => 1,
          'field_image' => [
            'alt',
          ],
        ],
      ],
    ],
  ]);
  $this
    ->drupalGet('/admin/lingotek/settings');
  $page = $this
    ->getSession()
    ->getPage();
  $contentTabDetails = $page
    ->find('css', '#edit-parent-details');
  $contentTabDetails
    ->click();
  $nodeTabDetails = $page
    ->find('css', '#edit-entity-node');
  $nodeTabDetails
    ->click();
  $this
    ->assertFieldChecked('edit-node-article-enabled');
  $this
    ->assertFieldChecked('edit-node-article-fields-title');
  $this
    ->assertNoFieldChecked('edit-node-article-fields-body');
  $this
    ->assertFieldChecked('edit-node-article-fields-uid');
  $this
    ->assertNoFieldChecked('edit-node-article-fields-field-text');
  $this
    ->assertFieldChecked('edit-node-article-fields-field-image');
  $this
    ->assertNoFieldChecked('edit-node-article-fields-field-imageproperties-file');
  $this
    ->assertFieldChecked('edit-node-article-fields-field-imageproperties-alt');
  $this
    ->assertNoFieldChecked('edit-node-article-fields-field-imageproperties-title');
  $fieldEnabled = $page
    ->find('css', '#edit-node-article-enabled');
  $fieldEnabled
    ->click();
  $this
    ->assertSession()
    ->assertWaitOnAjaxRequest();
  $this
    ->assertNoFieldChecked('edit-node-article-enabled');
  $fieldEnabled = $page
    ->find('css', '#edit-node-article-enabled');
  $fieldEnabled
    ->click();
  $this
    ->assertSession()
    ->assertWaitOnAjaxRequest();
  $this
    ->assertFieldChecked('edit-node-article-enabled');
  $this
    ->assertFieldChecked('edit-node-article-fields-title');

  // We marked body and field_text and kept the others as they were.
  $this
    ->assertFieldChecked('edit-node-article-fields-body');
  $this
    ->assertFieldChecked('edit-node-article-fields-uid');
  $this
    ->assertFieldChecked('edit-node-article-fields-field-text');
  $this
    ->assertFieldChecked('edit-node-article-fields-field-image');
  $this
    ->assertNoFieldChecked('edit-node-article-fields-field-imageproperties-file');
  $this
    ->assertFieldChecked('edit-node-article-fields-field-imageproperties-alt');
  $this
    ->assertNoFieldChecked('edit-node-article-fields-field-imageproperties-title');
}