'Home',
'slug' => 'home',
'content' => [['type' => 'text', 'data' => ['text' => 'Welcome home']]],
'cached_html' => '
Welcome home
',
'is_published' => true,
'user_id' => User::factory()->create()->id,
]);
$response = $this->get('/');
$response->assertStatus(200);
$response->assertSee('Welcome home');
$response->assertSee('theme-icehouse'); // Verify Icehouse theme is used
}
public function test_it_renders_dynamic_page(): void
{
$page = Page::create([
'title' => 'About Us',
'slug' => 'about-us',
'content' => [['type' => 'text', 'data' => ['text' => 'We are SiteWeaver']]],
'cached_html' => 'We are SiteWeaver
',
'is_published' => true,
'user_id' => User::factory()->create()->id,
]);
$response = $this->get('/about-us');
$response->assertStatus(200);
$response->assertSee('We are SiteWeaver');
$response->assertSee('About Us');
}
public function test_it_returns_404_for_non_existent_page(): void
{
$response = $this->get('/non-existent');
$response->assertStatus(404);
}
public function test_it_serves_theme_assets(): void
{
$response = $this->get('/themes/icehouse/assets/css/style.css');
$response->assertStatus(200);
$response->assertHeader('Content-Type', 'text/css; charset=utf-8');
$response->assertSee('theme-icehouse');
}
}