Ersetze die Symbolauswahl im CMS durch einen Wähler mit Raster, Gruppen und Suche
Das Feld steht in den Einstellungen aller Widgets und je Karte und Merkmal. Es trägt nur die Zeichnung des gewählten Symbols; der Katalog mit allen Zeichnungen kommt beim Öffnen in einer Anfrage (nur Redaktion und Katalogverwaltung). Mit Tastatur bedienbar. Dazu Katalog-Dokumentation, Tokens und Abnahme mit Screenshots (lokal geprüft, nicht auf luf-test). Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
edca8e864c
commit
1270e2e948
21 files changed
+409
-16
No files matched your search
@@ -6,6 +6,7 @@
|
||||
use App\Domain\Cms\PageService;
|
||||
use App\Domain\Cms\Widgets\Types\FeaturesWidget;
|
||||
use App\Domain\Cms\Widgets\WidgetRegistry;
|
||||
use App\Support\Brand\SymbolCatalog;
|
||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||
use Illuminate\Validation\ValidationException;
|
||||
use Tests\TestCase;
|
||||
@@ -42,6 +43,30 @@ private function publish(string $path, array $widget, string $layout = 'u4'): st
|
||||
return $this->get($path)->assertOk()->getContent();
|
||||
}
|
||||
|
||||
public function test_every_symbol_of_the_library_can_be_saved_and_is_shown_in_a_heading_a_card_and_a_feature(): void
|
||||
{
|
||||
$keys = array_keys(SymbolCatalog::options());
|
||||
$this->assertGreaterThanOrEqual(70, count($keys));
|
||||
|
||||
// Jeder angebotene Schlüssel wird gespeichert und mit seiner zugeschnittenen Zeichnung ausgegeben (eine Seite je Widgetart genügt, die Zuordnung der Zeichnung prüfen die Unit-Tests).
|
||||
$heading = $this->publish('/bibliothek-ueberschrift', $this->widget('heading', ['heading' => 'Filme'], ['symbol' => 'checkliste']));
|
||||
$this->assertMatchesRegularExpression('~<h2><svg[^>]*aria-hidden="true"[^>]*class="brand-symbol lf-heading-symbol"[^>]*viewBox="[\d. ]+"[^>]*>.*?</svg>Filme</h2>~s', $heading);
|
||||
|
||||
$cards = $this->publish('/bibliothek-karten', $this->widget('cards', ['items' => [['title' => 'Karte', 'url' => '/a', 'symbol' => 'zivilcourage']]]));
|
||||
$this->assertMatchesRegularExpression('~<svg[^>]*class="brand-symbol lf-card__symbol"~', $cards);
|
||||
|
||||
$features = $this->publish('/bibliothek-merkmale', $this->widget('features', ['items' => array_map(
|
||||
fn (string $key): array => ['symbol' => $key, 'title' => $key],
|
||||
array_slice($keys, 0, 12),
|
||||
)]));
|
||||
$this->assertSame(12, preg_match_all('~<svg[^>]*class="brand-symbol lf-features__symbol"~', $features));
|
||||
|
||||
// Alle Schlüssel nacheinander: nichts davon darf beim Speichern abgelehnt werden.
|
||||
foreach (array_chunk($keys, 12) as $index => $chunk) {
|
||||
$this->publish('/bibliothek-alle-'.$index, $this->widget('features', ['items' => array_map(fn (string $key): array => ['symbol' => $key, 'title' => $key], $chunk)]));
|
||||
}
|
||||
}
|
||||
|
||||
public function test_a_heading_shows_its_symbol_inside_the_heading_and_the_brush_below(): void
|
||||
{
|
||||
$html = $this->publish('/symbol', $this->widget('heading', ['heading' => 'Filme', 'intro' => 'Kurz erklärt'], ['symbol' => 'filmklappe', 'accent' => 'brush']));
|
||||
|
||||
Reference in new issue
Block a user