libra/tests/Feature/Components/LogoComponentTest.php

139 lines
3.9 KiB
PHP

<?php
// x-app-logo component tests
test('app-logo component renders with default props', function () {
$view = $this->blade('<x-app-logo />');
$view->assertSee('LIBRA for Rights');
$view->assertSee('logo.png');
});
test('app-logo component renders small size variant', function () {
$view = $this->blade('<x-app-logo size="sm" />');
$view->assertSee('h-8', false);
$view->assertSee('w-8', false);
});
test('app-logo component renders default size variant', function () {
$view = $this->blade('<x-app-logo size="md" />');
$view->assertSee('h-10', false);
$view->assertSee('w-10', false);
});
test('app-logo component renders large size variant', function () {
$view = $this->blade('<x-app-logo size="lg" />');
$view->assertSee('h-12', false);
$view->assertSee('w-12', false);
});
test('app-logo component renders without text when showText is false', function () {
$view = $this->blade('<x-app-logo :showText="false" />');
$view->assertDontSee('<span');
});
test('app-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('app-logo has accessible alt text', function () {
$view = $this->blade('<x-app-logo />');
$view->assertSee('alt="LIBRA for Rights"', false);
});
test('app-logo component accepts custom classes', function () {
$view = $this->blade('<x-app-logo class="custom-class" />');
$view->assertSee('custom-class', false);
});
// x-logo component tests
test('logo component renders with default md size', function () {
$view = $this->blade('<x-logo />');
$view->assertSee('logo.png');
$view->assertSee('h-12', false);
$view->assertSee('w-12', false);
});
test('logo component renders sm size for mobile nav', function () {
$view = $this->blade('<x-logo size="sm" />');
$view->assertSee('h-10', false);
$view->assertSee('w-10', false);
});
test('logo component renders lg size for footer', function () {
$view = $this->blade('<x-logo size="lg" />');
$view->assertSee('h-16', false);
$view->assertSee('w-16', false);
});
test('logo component renders xl size for auth pages', function () {
$view = $this->blade('<x-logo size="xl" />');
$view->assertSee('h-20', false);
$view->assertSee('w-20', false);
});
test('logo component has accessible alt text', function () {
$view = $this->blade('<x-logo />');
$view->assertSee('alt="LIBRA for Rights"', false);
});
test('logo component accepts custom classes', function () {
$view = $this->blade('<x-logo class="custom-test-class" />');
$view->assertSee('custom-test-class', false);
});
test('logo component has object-contain for aspect ratio', function () {
$view = $this->blade('<x-logo />');
$view->assertSee('object-contain', false);
});
// x-app-logo-icon component tests
test('app-logo-icon component renders with default md size', function () {
$view = $this->blade('<x-app-logo-icon />');
$view->assertSee('logo.png');
$view->assertSee('h-9', false);
$view->assertSee('w-9', false);
});
test('app-logo-icon component renders sm size', function () {
$view = $this->blade('<x-app-logo-icon size="sm" />');
$view->assertSee('h-7', false);
$view->assertSee('w-7', false);
});
test('app-logo-icon component renders lg size', function () {
$view = $this->blade('<x-app-logo-icon size="lg" />');
$view->assertSee('h-12', false);
$view->assertSee('w-12', false);
});
test('app-logo-icon has accessible alt text', function () {
$view = $this->blade('<x-app-logo-icon />');
$view->assertSee('alt="LIBRA for Rights"', false);
});
test('app-logo-icon component accepts custom classes', function () {
$view = $this->blade('<x-app-logo-icon class="icon-custom-class" />');
$view->assertSee('icon-custom-class', false);
});