You are here

public function UiPatternsLibraryBadDefinitionTest::testErrorMessages in UI Patterns 8

Test error messages for invalid pattern definitions.

File

modules/ui_patterns_library/tests/src/FunctionalJavascript/UiPatternsLibraryBadDefinitionTest.php, line 33

Class

UiPatternsLibraryBadDefinitionTest
Test invalid definition error messages.

Namespace

Drupal\Tests\ui_patterns_library\FunctionalJavascript

Code

public function testErrorMessages() {
  $session = $this
    ->assertSession();
  $user = $this
    ->drupalCreateUser([
    'access patterns page',
  ]);
  $this
    ->drupalLogin($user);
  drupal_flush_all_caches();
  $this
    ->drupalGet('/patterns');
  $session
    ->pageTextContains("Pattern 'bad_definition' is skipped because of the following validation error(s):");
  $session
    ->pageTextContains('Validation error on "bad_definition.label": This value should not be null.');
}