Skip to content

Commit

Permalink
improve coverage for Template Whisperer deletion
Browse files Browse the repository at this point in the history
  • Loading branch information
WengerK committed Feb 21, 2024
1 parent e275cbe commit f59fdac
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions tests/src/Functional/UiPageTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,22 +112,35 @@ public function testDelete() {
// Setup a template whisperer with one suggestion.
$this->testCreate();

// Test Delete from listing page.
$this->clickLink('Delete');
$this->assertSession()->addressEquals('admin/structure/template-whisperer/test/delete');
$this->assertSession()->pageTextContains('Are you sure you want to delete the suggestion "Test Template Whisperer"?');
$this->assertSession()->pageTextContains('This action cannot be undone.');

$this->pressButton('Delete');
$this->assertSession()->addressEquals('admin/structure/template-whisperer');
$this->assertSession()->pageTextContains('No suggestion has currently been set.');
$this->assertSession()->pageTextContains('The suggestion "Test Template Whisperer" has been deleted.');

// Test Delete into entity.
$this->testCreate();
$this->clickLink('Edit');
$this->assertSession()->addressEquals('admin/structure/template-whisperer/test/edit');
$this->clickLink('Delete');
$this->assertSession()->addressEquals('admin/structure/template-whisperer/test/delete');
$this->assertSession()->pageTextContains('Are you sure you want to delete the suggestion "Test Template Whisperer"?');
$this->assertSession()->pageTextContains('This action cannot be undone.');
$this->pressButton('Delete');
$this->assertSession()->addressEquals('admin/structure/template-whisperer');
$this->assertSession()->pageTextContains('No suggestion has currently been set.');
$this->assertSession()->pageTextContains('The suggestion "Test Template Whisperer" has been deleted.');

// Cancel deletion.
$this->testCreate();
$this->clickLink('Delete');
$this->assertSession()->addressEquals('admin/structure/template-whisperer/test/delete');
$this->clickLink('Cancel');
$this->assertSession()->statusCodeEquals(200);
$this->assertSession()->pageTextNotContains('The suggestion "Test Template Whisperer" has been deleted.');
}

/**
Expand Down

0 comments on commit f59fdac

Please sign in to comment.