65 lines
2.2 KiB
PHP
Executable File
65 lines
2.2 KiB
PHP
Executable File
<?php
|
|
|
|
namespace Modules\Stylist\Tests\Feature;
|
|
|
|
use Tests\TestCase;
|
|
|
|
final class WelcomeThemeViewTest extends TestCase
|
|
{
|
|
public function test_bundled_frontend_theme_view_namespace_is_registered(): void
|
|
{
|
|
$this->assertTrue(view()->exists('stylist-theme-frontend::welcome'));
|
|
}
|
|
|
|
public function test_dashboard_view_is_owned_by_the_backend_theme(): void
|
|
{
|
|
$this->assertStringContainsString(
|
|
resource_path('themes/backend/views/dashboard.blade.php'),
|
|
view('dashboard')->getPath(),
|
|
);
|
|
}
|
|
|
|
public function test_home_route_renders_from_the_frontend_theme(): void
|
|
{
|
|
$response = $this->get('/');
|
|
|
|
$response->assertOk()->assertViewIs('welcome');
|
|
$this->assertStringContainsString(
|
|
resource_path('themes/frontend/views/welcome.blade.php'),
|
|
view('welcome')->getPath(),
|
|
);
|
|
}
|
|
|
|
public function test_application_views_exist_only_inside_themes(): void
|
|
{
|
|
$this->assertDirectoryDoesNotExist(resource_path('views'));
|
|
$this->assertDirectoryDoesNotExist(resource_path('css'));
|
|
$this->assertDirectoryDoesNotExist(resource_path('js'));
|
|
}
|
|
|
|
public function test_backend_compiled_assets_are_owned_by_the_backend_theme(): void
|
|
{
|
|
$this->assertFileExists(resource_path('themes/backend/assets/css/app.css'));
|
|
$this->assertFileExists(resource_path('themes/backend/assets/js/passkeys.js'));
|
|
}
|
|
|
|
public function test_view_finder_contains_only_existing_application_view_locations(): void
|
|
{
|
|
foreach (view()->getFinder()->getPaths() as $path) {
|
|
$this->assertDirectoryExists($path);
|
|
}
|
|
}
|
|
|
|
public function test_backend_flux_icon_overrides_are_owned_by_the_backend_theme(): void
|
|
{
|
|
$this->assertTrue(view()->exists('flux::icon.folder-git-2'));
|
|
$this->assertTrue(view()->exists('flux::icon.book-open-text'));
|
|
$this->assertTrue(view()->exists('flux::icon.chevrons-up-down'));
|
|
|
|
$this->assertStringContainsString(
|
|
resource_path('themes/backend/views/flux/icon/folder-git-2.blade.php'),
|
|
view('flux::icon.folder-git-2')->getPath(),
|
|
);
|
|
}
|
|
}
|