You are here

public function ConfigTranslationUiTest::testMenuTranslationWithoutChange in Drupal 9

Test translation save confirmation message.

File

core/modules/config_translation/tests/src/Functional/ConfigTranslationUiTest.php, line 1097

Class

ConfigTranslationUiTest
Translate settings and entities to various languages.

Namespace

Drupal\Tests\config_translation\Functional

Code

public function testMenuTranslationWithoutChange() {
  $this
    ->drupalLogin($this->adminUser);
  $this
    ->drupalGet('admin/structure/menu/manage/main/translate/tyv/add');
  $this
    ->submitForm([], 'Save translation');
  $this
    ->assertSession()
    ->pageTextContains('Tuvan translation was not added. To add a translation, you must modify the configuration.');
  $this
    ->drupalGet('admin/structure/menu/manage/main/translate/tyv/add');
  $edit = [
    'translation[config_names][system.menu.main][label]' => 'Main navigation Translation',
    'translation[config_names][system.menu.main][description]' => 'Site section links Translation',
  ];
  $this
    ->submitForm($edit, 'Save translation');
  $this
    ->assertSession()
    ->pageTextContains('Successfully saved Tuvan translation.');
}