You are here

trait TranslationTestTrait in Layout Builder Symmetric Translations 8

Common functions for testing Layout Builder with translations.

Hierarchy

3 files declare their use of TranslationTestTrait
InlineBlockTranslationTest.php in tests/src/FunctionalJavascript/InlineBlockTranslationTest.php
ModeratedTranslationTest.php in tests/src/FunctionalJavascript/ModeratedTranslationTest.php
TranslationTest.php in tests/src/FunctionalJavascript/TranslationTest.php

File

tests/src/Functional/TranslationTestTrait.php, line 8

Namespace

Drupal\Tests\layout_builder_st\Functional
View source
trait TranslationTestTrait {

  /**
   * Asserts that non-trans actions have been removed.
   */
  protected function assertNonTranslationActionsRemoved() {

    /** @var \Drupal\Tests\WebAssert $assert_session */
    $assert_session = $this
      ->assertSession();

    // Confirm that links do not exist to change the layout.
    $assert_session
      ->linkNotExists('Add Section');
    $assert_session
      ->linkNotExists('Add Block');
    $assert_session
      ->linkNotExists('Remove section');
    $assert_session
      ->elementNotExists('css', '[data-contextual-id^="layout_builder_block:"]');
    $assert_session
      ->buttonNotExists('Revert to defaults');
  }

}

Members

Namesort descending Modifiers Type Description Overrides
TranslationTestTrait::assertNonTranslationActionsRemoved protected function Asserts that non-trans actions have been removed.