<?php

use Tricks\Dashboard\Dashboard;
use Tricks\Dashboard\Main;
use Tricks\NovaPhpInformationCard\NovaPhpInformationCard;

test('confirm config loaded', function () {
    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 () {
    expect((new Dashboard())->meta())->toBe(config('nova-dashboard'));
});

test('confirm dashboard has correct attributes', function () {
    expect((new Dashboard())->component())->toBe('dashboard');
});

test('confirm main has correct cards', function () {
    expect((new Main())->cards())
        ->toBeArray()
        ->each(fn ($expectation
        ) => $expectation->value instanceof Dashboard or $expectation->value instanceof NovaPhpInformationCard);
});
