seed(\Database\Seeders\CmsBrandSeeder::class);
});
it('creates the joinery as the fourth brand without touching the existing ones', function () {
expect(CmsBrand::count())->toBe(4);
$brand = CmsBrand::where('slug', 'tischlerei')->firstOrFail();
expect($brand->order)->toBe(4)
->and($brand->is_published)->toBeTrue()
->and($brand->logo)->toBe('')
->and($brand->sections)->toHaveCount(3);
// Erneutes Seeden legt nichts doppelt an.
$this->seed(\Database\Seeders\CmsBrandSeeder::class);
expect(CmsBrand::count())->toBe(4);
});
it('shows four tiles on the homepage in a two by two grid', function () {
$html = $this->get('/')->assertSuccessful()->getContent();
expect($html)->toContain('Tischlerei')
->toContain('/marken/tischlerei')
->toMatch('/
]*class="grid sm:grid-cols-2 gap-8[^"]*"/')
->not->toContain('xl:grid-cols-4');
});
it('lists the joinery on the brands page after the three established brands', function () {
$html = $this->get('/marken')->assertSuccessful()->getContent();
preg_match_all('#wire:key="brand-([a-z-]+)"#', $html, $matches);
expect($matches[1])->toBe(['cabinet', 'rotpunkt', 'februe', 'tischlerei']);
expect($html)->toContain('Sonderlösungen nach Aufmaß');
});
it('serves the joinery detail page with the placeholder texts and the wordmark', function () {
$this->get('/marken/tischlerei')
->assertSuccessful()
->assertSee('
Tischlerei
', false)
->assertSee('Maßarbeit, die den Raum vollendet.', false)
->assertSee('Wo Serienmöbel aufhören.', false)
->assertSee('Ergänzung, nicht Konkurrenz.', false)
->assertSee('Ihr Raum. Bis ins Detail gefertigt.', false)
->assertSee('data-appointment-topic="tischlerei"', false);
});
it('offers the joinery among the other brands of every detail page, three across', function () {
$html = $this->get('/marken/cabinet')->assertSuccessful()->getContent();
expect($html)->toContain('other-tischlerei')
->toContain('sm:grid-cols-2 lg:grid-cols-3');
});
it('labels the widget on the joinery page and offers the joinery as a topic everywhere', function () {
$this->get('/marken/tischlerei')
->assertSuccessful()
->assertSee('Persönliche Beratung zur Maßarbeit vereinbaren', false);
expect(Livewire::test(AppointmentWidget::class)->get('topics'))->toHaveKey('tischlerei');
$this->get('/contact')
->assertSuccessful()
->assertSee('value="tischlerei"', false);
});
it('keeps the joinery in the lang fallback while no brands are maintained', function () {
CmsBrand::query()->delete();
$this->get('/')
->assertSuccessful()
->assertSee('Tischlerei')
->assertSee('Maßarbeit, die den Raum vollendet.', false);
});