libra/tests/Feature/Components/LogoComponentTest.php

83 lines
2.3 KiB
PHP

<?php
test('logo component renders with default props', function () {
$view = $this->blade('<x-app-logo />');
$view->assertSee('LIBRA for Rights');
$view->assertSee('logo.svg');
});
test('logo component renders small size variant', function () {
$view = $this->blade('<x-app-logo size="small" />');
$view->assertSee('h-8');
});
test('logo component renders default size variant', function () {
$view = $this->blade('<x-app-logo size="default" />');
$view->assertSee('h-12');
});
test('logo component renders large size variant', function () {
$view = $this->blade('<x-app-logo size="large" />');
$view->assertSee('h-16');
});
test('logo component renders reversed color variant', function () {
$view = $this->blade('<x-app-logo variant="reversed" />');
$view->assertSee('logo-reversed.svg');
});
test('logo component renders mono color variant', function () {
$view = $this->blade('<x-app-logo variant="mono" />');
$view->assertSee('logo-mono.svg');
});
test('logo component renders without text when showText is false', function () {
$view = $this->blade('<x-app-logo :showText="false" />');
$view->assertDontSee('<span');
});
test('logo component renders with text when showText is true', function () {
$view = $this->blade('<x-app-logo :showText="true" />');
$view->assertSee('<span', false);
$view->assertSee('LIBRA for Rights');
});
test('logo has accessible alt text', function () {
$view = $this->blade('<x-app-logo />');
$view->assertSee('alt="LIBRA for Rights"', false);
});
test('logo has PNG fallback via onerror attribute', function () {
$view = $this->blade('<x-app-logo />');
$view->assertSee('logo.png', false);
$view->assertSee('onerror', false);
});
test('logo component accepts custom classes', function () {
$view = $this->blade('<x-app-logo class="custom-class" />');
$view->assertSee('custom-class', false);
});
test('logo component has correct minimum width for desktop', function () {
$view = $this->blade('<x-app-logo size="default" />');
$view->assertSee('min-w-[120px]', false);
});
test('logo component has correct minimum width for mobile', function () {
$view = $this->blade('<x-app-logo size="small" />');
$view->assertSee('min-w-[80px]', false);
});