mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-05-20 15:09:38 +00:00
Testing: Fixed issues during pre-release testing
- Updated locale list - Fixed new name sorting not being case insensitive - Updated license test to account for changed deps
This commit is contained in:
parent
6211d6bcfc
commit
13dae24cbe
4 changed files with 38 additions and 3 deletions
tests/Sorting
|
@ -187,6 +187,40 @@ class SortRuleTest extends TestCase
|
|||
$this->assertNotEquals($oldPriority, $chapter->priority);
|
||||
}
|
||||
|
||||
public function test_name_alphabetical_ordering()
|
||||
{
|
||||
$book = Book::factory()->create();
|
||||
$rule = SortRule::factory()->create(['sequence' => 'name_asc']);
|
||||
$book->sort_rule_id = $rule->id;
|
||||
$book->save();
|
||||
$this->permissions->regenerateForEntity($book);
|
||||
|
||||
$namesToAdd = [
|
||||
"Beans",
|
||||
"bread",
|
||||
"Milk",
|
||||
"pizza",
|
||||
"Tomato",
|
||||
];
|
||||
|
||||
$reverseNamesToAdd = array_reverse($namesToAdd);
|
||||
foreach ($reverseNamesToAdd as $name) {
|
||||
$this->actingAsApiEditor()->post("/api/pages", [
|
||||
'book_id' => $book->id,
|
||||
'name' => $name,
|
||||
'markdown' => 'Hello'
|
||||
]);
|
||||
}
|
||||
|
||||
foreach ($namesToAdd as $index => $name) {
|
||||
$this->assertDatabaseHas('pages', [
|
||||
'book_id' => $book->id,
|
||||
'name' => $name,
|
||||
'priority' => $index + 1,
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
public function test_name_numeric_ordering()
|
||||
{
|
||||
$book = Book::factory()->create();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue