]> BookStack Code Mirror - bookstack/blobdiff - tests/Entity/SortTest.php
Updated tests to use ssddanbrown/asserthtml package
[bookstack] / tests / Entity / SortTest.php
index 7b10278b06c8f422015af0630fcf5473a6caaa68..8792e70db31b57d2b678d625533a51af83c4f67a 100644 (file)
@@ -247,7 +247,7 @@ class SortTest extends TestCase
         $bookToSort = Book::query()->first();
 
         $resp = $this->asAdmin()->get($bookToSort->getUrl());
-        $resp->assertElementExists('a[href="' . $bookToSort->getUrl('/sort') . '"]');
+        $this->withHtml($resp)->assertElementExists('a[href="' . $bookToSort->getUrl('/sort') . '"]');
 
         $resp = $this->get($bookToSort->getUrl('/sort'));
         $resp->assertStatus(200);
@@ -456,14 +456,14 @@ class SortTest extends TestCase
         $book->pages()->whereNotIn('id', $pages->pluck('id'))->delete();
 
         $resp = $this->asEditor()->get($book->getUrl());
-        $resp->assertElementContains('.content-wrap a.page:nth-child(1)', $pages[0]->name);
-        $resp->assertElementContains('.content-wrap a.page:nth-child(2)', $pages[1]->name);
+        $this->withHtml($resp)->assertElementContains('.content-wrap a.page:nth-child(1)', $pages[0]->name);
+        $this->withHtml($resp)->assertElementContains('.content-wrap a.page:nth-child(2)', $pages[1]->name);
 
         $pages[0]->forceFill(['priority' => 10])->save();
         $pages[1]->forceFill(['priority' => 5])->save();
 
         $resp = $this->asEditor()->get($book->getUrl());
-        $resp->assertElementContains('.content-wrap a.page:nth-child(1)', $pages[1]->name);
-        $resp->assertElementContains('.content-wrap a.page:nth-child(2)', $pages[0]->name);
+        $this->withHtml($resp)->assertElementContains('.content-wrap a.page:nth-child(1)', $pages[1]->name);
+        $this->withHtml($resp)->assertElementContains('.content-wrap a.page:nth-child(2)', $pages[0]->name);
     }
 }