You are here

public function LingotekProfileFormTest::testDefaultProfilesPresent in Lingotek Translation 8

Test that default profiles are present.

File

src/Tests/Form/LingotekProfileFormTest.php, line 28

Class

LingotekProfileFormTest
Tests the Lingotek profile form.

Namespace

Drupal\lingotek\Tests\Form

Code

public function testDefaultProfilesPresent() {
  $this
    ->drupalGet('admin/lingotek/settings');

  // Status of the checkbox matrix is as expected.
  $this
    ->assertFieldChecked('edit-profile-automatic-auto-upload');
  $this
    ->assertFieldChecked('edit-profile-automatic-auto-download');
  $this
    ->assertNoFieldChecked('edit-profile-manual-auto-upload');
  $this
    ->assertNoFieldChecked('edit-profile-manual-auto-download');
  $this
    ->assertNoFieldChecked('edit-profile-disabled-auto-upload');
  $this
    ->assertNoFieldChecked('edit-profile-disabled-auto-download');

  // We cannot edit them.
  $this
    ->assertNoLinkByHref('/admin/lingotek/settings/profile/automatic/edit');
  $this
    ->assertNoLinkByHref('/admin/lingotek/settings/profile/manual/edit');
  $this
    ->assertNoLinkByHref('/admin/lingotek/settings/profile/disabled/edit');

  // The fields are disabled.
  $this
    ->assertFieldDisabled('edit-profile-automatic-auto-upload');
  $this
    ->assertFieldDisabled('edit-profile-automatic-auto-download');
  $this
    ->assertFieldDisabled('edit-profile-manual-auto-upload');
  $this
    ->assertFieldDisabled('edit-profile-manual-auto-download');
  $this
    ->assertFieldDisabled('edit-profile-disabled-auto-upload');
  $this
    ->assertFieldDisabled('edit-profile-disabled-auto-download');
}