mirror of
https://github.com/VueFileManager/vuefilemanager.git
synced 2026-04-24 18:00:40 +00:00
added it_get_all_pages, it_get_page, it_update_page test
This commit is contained in:
@@ -4,6 +4,7 @@ namespace Tests\Feature;
|
||||
|
||||
use App\Models\File;
|
||||
use App\Models\Folder;
|
||||
use App\Models\Page;
|
||||
use App\Models\Setting;
|
||||
use App\Models\Share;
|
||||
use App\Models\User;
|
||||
@@ -435,4 +436,52 @@ class AdminTest extends TestCase
|
||||
Storage::disk('local')
|
||||
->assertMissing($user->settings->getRawOriginal('avatar'));
|
||||
}
|
||||
|
||||
/**
|
||||
* @test
|
||||
*/
|
||||
public function it_get_all_pages()
|
||||
{
|
||||
$this->setup->seed_pages();
|
||||
|
||||
collect(['terms-of-service', 'privacy-policy', 'cookie-policy'])
|
||||
->each(function ($slug) {
|
||||
$this->getJson('/api/admin/pages')
|
||||
->assertStatus(200)
|
||||
->assertJsonFragment([
|
||||
'slug' => $slug
|
||||
]);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @test
|
||||
*/
|
||||
public function it_get_page()
|
||||
{
|
||||
$this->setup->seed_pages();
|
||||
|
||||
$this->getJson('/api/admin/pages/terms-of-service')
|
||||
->assertStatus(200)
|
||||
->assertJsonFragment([
|
||||
'slug' => 'terms-of-service'
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @test
|
||||
*/
|
||||
public function it_update_page()
|
||||
{
|
||||
$this->setup->seed_pages();
|
||||
|
||||
$this->patchJson('/api/admin/pages/terms-of-service', [
|
||||
'name' => 'title',
|
||||
'value' => 'New Title'
|
||||
])->assertStatus(204);
|
||||
|
||||
$this->assertDatabaseHas('pages', [
|
||||
'title' => 'New Title'
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user