Füge Symbol vor Überschriften, Pinselstrich und Merkmalszeile ins CMS ein
CI Feature / test (push) Successful in 2m40s
CI Feature / test (push) Successful in 2m40s
Die Kleingrafiken des Brand-Kits sind jetzt im Redaktionsinhalt wählbar, nicht nur an Medienkarten: - Einstellung "Symbol vor der Überschrift" (settings.symbol) an Überschrift, Einstieg, Bild und Text und Handlungsaufruf. Feste Auswahl von 14 Symbolen (HeadingAccent::SYMBOLS), ein unbekannter Name wird beim Speichern abgewiesen. - Einstellung "Pinselstrich" (settings.accent = brush) am Widget Überschrift. - Neues Widget "Merkmalszeile" (features): zwei bis vier Merkmale mit Symbol, Kurztitel und Satz; die Anzahl bestimmt die Spalten. - Auf dunklen Flächen stehen die Symbole auf einer weißen Scheibe, weil sie feste Markenfarben mit viel Navy haben. - brand/symbol erzeugt keine Zeilenumbrüche mehr um das SVG, damit es im Fließtext und in Überschriften keine zusätzliche Lücke gibt. Der Test der Widget-Reihenfolge kennt das neue Widget bewusst (features nach cards). Stufe 3b (Symbole mitten im Fließtext) bleibt zurückgestellt. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
bb08b9b3fa
commit
cf8189623c
23 files changed
+541
-15
No files matched your search
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\Unit;
|
||||
|
||||
use App\Domain\Cms\Widgets\Support\HeadingAccent;
|
||||
use App\Support\Brand\Symbols;
|
||||
use Tests\TestCase;
|
||||
|
||||
class HeadingAccentTest extends TestCase
|
||||
{
|
||||
public function test_every_offered_symbol_has_a_file_and_only_the_two_accents_are_withheld(): void
|
||||
{
|
||||
$files = Symbols::names();
|
||||
$offered = array_keys(HeadingAccent::SYMBOLS);
|
||||
|
||||
$this->assertSame([], array_values(array_diff($offered, $files)), 'Jede Auswahl braucht eine vorhandene Datei.');
|
||||
$this->assertSame(['gelbe-unterstreichung', 'signalstrahlen'], array_values(array_diff($files, $offered)), 'Unterstreichung und Strahlen haben eigene Einstellungen.');
|
||||
}
|
||||
|
||||
public function test_labels_are_present_for_every_symbol(): void
|
||||
{
|
||||
foreach (HeadingAccent::SYMBOLS as $name => $label) {
|
||||
$this->assertNotSame('', trim($label), $name);
|
||||
}
|
||||
}
|
||||
|
||||
public function test_only_known_names_are_accepted(): void
|
||||
{
|
||||
$this->assertSame('buch', HeadingAccent::symbol(['symbol' => 'buch']));
|
||||
$this->assertNull(HeadingAccent::symbol([]));
|
||||
$this->assertNull(HeadingAccent::symbol(['symbol' => '']));
|
||||
$this->assertNull(HeadingAccent::symbol(['symbol' => '../../.env']));
|
||||
$this->assertNull(HeadingAccent::symbol(['symbol' => 'signalstrahlen']));
|
||||
$this->assertNull(HeadingAccent::symbol(['symbol' => ['buch']]));
|
||||
}
|
||||
|
||||
public function test_the_brush_needs_the_exact_value(): void
|
||||
{
|
||||
$this->assertTrue(HeadingAccent::hasBrush(['accent' => 'brush']));
|
||||
$this->assertFalse(HeadingAccent::hasBrush(['accent' => 'rays']));
|
||||
$this->assertFalse(HeadingAccent::hasBrush([]));
|
||||
}
|
||||
}
|
||||
@@ -28,7 +28,7 @@ public function test_all_configured_widgets_are_registered_with_complete_contrac
|
||||
$types = $this->registry()->all();
|
||||
|
||||
$this->assertSame(
|
||||
['hero', 'heading', 'prose', 'image_text', 'cards', 'catalog_cards', 'topic_card', 'media_card', 'program_card', 'call_to_action', 'faq'],
|
||||
['hero', 'heading', 'prose', 'image_text', 'cards', 'features', 'catalog_cards', 'topic_card', 'media_card', 'program_card', 'call_to_action', 'faq'],
|
||||
array_keys($types),
|
||||
);
|
||||
|
||||
|
||||
Reference in new issue
Block a user