You are here

public function StockLevelFormatterTest::testDefaultFormatter in Commerce Stock 8

Whether the default formatter appears on product add to cart forms.

Throws

\Behat\Mink\Exception\ElementHtmlException

\Behat\Mink\Exception\ResponseTextException

File

modules/field/tests/src/Functional/StockLevelFormatterTest.php, line 28

Class

StockLevelFormatterTest
Provides tests for stock level field default formatter.

Namespace

Drupal\Tests\commerce_stock_field\Functional

Code

public function testDefaultFormatter() {
  $this
    ->drupalGet('product/' . $this->product
    ->id());
  $this
    ->saveHtmlOutput();
  $this
    ->assertSession()
    ->pageTextContains('stock_level_test');
  $this
    ->assertSession()
    ->elementContains('css', '.product--variation-field--variation_stock_level_test__1', '10');
}