feat: replace the navigation with a dashboard and per-area boards
This commit is contained in:
1 parent
d63df2cc1b
commit
bce8f58be3
26 files changed
+810
-328
No files matched your search
@@ -0,0 +1,56 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Tests\Entity;
|
||||
|
||||
use App\Entity\ResourceType;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
class ResourceTypeTest extends TestCase
|
||||
{
|
||||
public function testEverySlugResolvesBackToItsCase(): void
|
||||
{
|
||||
foreach (ResourceType::cases() as $type) {
|
||||
self::assertSame($type, ResourceType::fromSlug($type->slug()));
|
||||
}
|
||||
}
|
||||
|
||||
public function testSlugsAreUnique(): void
|
||||
{
|
||||
$slugs = array_map(static fn (ResourceType $type): string => $type->slug(), ResourceType::cases());
|
||||
|
||||
self::assertSame($slugs, array_unique($slugs));
|
||||
}
|
||||
|
||||
public function testAnUnknownSlugIsRejected(): void
|
||||
{
|
||||
$this->expectException(\ValueError::class);
|
||||
|
||||
ResourceType::fromSlug('fahrraeder');
|
||||
}
|
||||
|
||||
/**
|
||||
* The URL slugs are German while the backing values stay English, because the values are
|
||||
* persisted in resource.type and renaming them would need a migration.
|
||||
*/
|
||||
public function testTheSlugIsNotTheStoredValue(): void
|
||||
{
|
||||
self::assertSame('desk', ResourceType::DESK->value);
|
||||
self::assertSame('schreibtische', ResourceType::DESK->slug());
|
||||
}
|
||||
|
||||
/**
|
||||
* Every case must carry the presentation a dashboard tile needs, or adding one would produce
|
||||
* a broken tile rather than a working one.
|
||||
*/
|
||||
public function testEveryCaseIsFullyDescribed(): void
|
||||
{
|
||||
foreach (ResourceType::cases() as $type) {
|
||||
self::assertNotSame('', $type->label());
|
||||
self::assertNotSame('', $type->plural());
|
||||
self::assertNotSame('', $type->description());
|
||||
self::assertStringStartsWith('lucide:', $type->icon());
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user