You are here

public function CKEditorStylesComboTranslationTest::testExistingFormat in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/ckeditor/tests/src/Functional/CKEditorStylesComboTranslationTest.php \Drupal\Tests\ckeditor\Functional\CKEditorStylesComboTranslationTest::testExistingFormat()

Tests translations of CKEditor styles configuration.

File

core/modules/ckeditor/tests/src/Functional/CKEditorStylesComboTranslationTest.php, line 71

Class

CKEditorStylesComboTranslationTest
Tests administration of the CKEditor StylesCombo plugin.

Namespace

Drupal\Tests\ckeditor\Functional

Code

public function testExistingFormat() {
  $this
    ->drupalLogin($this->adminUser);
  $edit = [
    'editor[settings][plugins][stylescombo][styles]' => 'h1.title|Title',
  ];
  $this
    ->drupalGet('admin/config/content/formats/manage/' . $this->format);
  $this
    ->submitForm($edit, 'Save configuration');
  $this
    ->drupalGet('admin/config/content/formats/manage/' . $this->format . '/translate/de/add');
  $this
    ->assertEquals('textarea', $this
    ->assertSession()
    ->fieldExists('List of styles')
    ->getTagName());
  $this
    ->assertSession()
    ->fieldValueEquals('List of styles', 'h1.title|Title');
  $page = $this
    ->getSession()
    ->getPage();
  $page
    ->fillField('List of styles', 'h1.title|Titel');
  $page
    ->pressButton('Save translation');
  $this
    ->assertSession()
    ->pageTextContains('Successfully saved German translation.');
}