Skip to content

Commit a6ba8dd

Browse files
committed
Testing: Improved reliability
- Added extra column/value check for page revision test for accuracy. - Changed search sort test to use more reliable values. - Change due to database seeding somtimes generating values that proceeded the test value, expected to be first, in sort results.
1 parent 7017a1c commit a6ba8dd

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

tests/Commands/UpdateUrlCommandTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ public function test_command_updates_page_revisions()
102102
setting()->flushCache();
103103

104104
$this->assertDatabaseHas('page_revisions', [
105+
'page_id' => $page->id,
105106
'markdown' => '[A link 1](https://cats.example.com/donkey/cat)',
106107
'html' => '<p id="bkmrk-a-link-1"><a href="https://cats.example.com/donkey/cat">A link 1</a></p>' . "\n"
107108
]);

tests/Entity/EntitySearchTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -393,11 +393,11 @@ public function test_sibling_search_for_books_provides_results_in_alphabetical_o
393393
$search = $this->actingAs($this->users->viewer())->get("/search/entity/siblings?entity_id={$contextBook->id}&entity_type=book");
394394
$this->withHtml($search)->assertElementNotContains('a:first-child', 'Zebras');
395395

396-
$searchBook->name = 'AAAAAAArdvarks';
396+
$searchBook->name = '1AAAAAAArdvarks';
397397
$searchBook->save();
398398

399399
$search = $this->actingAs($this->users->viewer())->get("/search/entity/siblings?entity_id={$contextBook->id}&entity_type=book");
400-
$this->withHtml($search)->assertElementContains('a:first-child', 'AAAAAAArdvarks');
400+
$this->withHtml($search)->assertElementContains('a:first-child', '1AAAAAAArdvarks');
401401
}
402402

403403
public function test_sibling_search_for_shelves_provides_results_in_alphabetical_order()
@@ -411,11 +411,11 @@ public function test_sibling_search_for_shelves_provides_results_in_alphabetical
411411
$search = $this->actingAs($this->users->viewer())->get("/search/entity/siblings?entity_id={$contextShelf->id}&entity_type=bookshelf");
412412
$this->withHtml($search)->assertElementNotContains('a:first-child', 'Zebras');
413413

414-
$searchShelf->name = 'AAAAAAArdvarks';
414+
$searchShelf->name = '1AAAAAAArdvarks';
415415
$searchShelf->save();
416416

417417
$search = $this->actingAs($this->users->viewer())->get("/search/entity/siblings?entity_id={$contextShelf->id}&entity_type=bookshelf");
418-
$this->withHtml($search)->assertElementContains('a:first-child', 'AAAAAAArdvarks');
418+
$this->withHtml($search)->assertElementContains('a:first-child', '1AAAAAAArdvarks');
419419
}
420420

421421
public function test_search_works_on_updated_page_content()

0 commit comments

Comments
 (0)