<?php

use Pest\Expectation;
use Tricks\Dashboard\HelpCard;
use Tricks\Dashboard\Main;

test('confirm config loaded', function (): void {
    expect(config('nova-dashboard'))
        ->toBe([
            'elements' => [
                [
                    'title' => 'Suche',
                    'text' => 'Hier können Sie Begriffe eingeben, um nach Navigationspunkten oder Inhalten zu suchen.',
                    'link' => null,
                ],
                [
                    'title' => 'Ressourcen',
                    'text' => 'Unter Ressourcen finden Sie die User-Verwaltung und die Bearbeitungsfunktionen für die editierbaren Bereiche Ihrer Website.',
                    'link' => null,
                ],
            ],
        ]);
});

test('confirm dashboard has meta', function (): void {
    expect((new HelpCard)->meta())->toBe(config('nova-dashboard'));
});

test('confirm dashboard has correct attributes', function (): void {
    expect((new HelpCard)->component())->toBe('help-card');
});

test('confirm main has correct cards', function (): void {
    expect((new Main)->cards())
        ->toBeArray()
        ->each(fn (Expectation $expectation): bool => $expectation->value instanceof HelpCard);
});
