You are here

public function ProductTabsTest::testNonProductTabs in Ubercart 8.4

Tests that product tabs don't show up elsewhere.

File

uc_product/tests/src/Functional/ProductTabsTest.php, line 63

Class

ProductTabsTest
Tests the product edit page tabs.

Namespace

Drupal\Tests\uc_product\Functional

Code

public function testNonProductTabs() {

  /** @var \Drupal\Tests\WebAssert $assert */
  $assert = $this
    ->assertSession();
  $this
    ->drupalCreateContentType([
    'type' => 'page',
  ]);
  $page = $this
    ->drupalCreateNode([
    'type' => 'page',
  ]);
  $this
    ->drupalGet('node/' . $page
    ->id() . '/edit');

  // Check we are on the edit page.
  $assert
    ->fieldValueEquals('title[0][value]', $page
    ->getTitle());

  // Check that each of the tabs do not exist.
  $assert
    ->linkNotExists('Product');
  $assert
    ->linkNotExists('Attributes');
  $assert
    ->linkNotExists('Options');
  $assert
    ->linkNotExists('Adjustments');
  $assert
    ->linkNotExists('Features');
  $assert
    ->linkNotExists('Stock');
}