You are here

public function ClassyParagraphsTest::testClassyParagraphsCheckSingleStyle in Classy paragraphs 8

Test the appearance of a single style.

File

src/Tests/ClassyParagraphsTest.php, line 92

Class

ClassyParagraphsTest
Tests the classy_paragraphs_test module.

Namespace

Drupal\classy_paragraphs\Tests

Code

public function testClassyParagraphsCheckSingleStyle() {
  $style = [
    'cp_test_loud',
  ];
  $style_css = 'loud-background';

  /** @var \Drupal\node\Entity\Node $node */
  list($node) = $this
    ->createNodeWithParagraph($style);
  $this
    ->drupalGet('node/' . $node
    ->id());
  $class = $this
    ->xpath('//*[contains(@class, "' . $style_css . '")]');
  $this
    ->assertTrue(count($class) == 1, $style_css . ' class found.');
}