Zeige Aufzählungszeichen und Nummern in Bild und Text sowie auf Shop- und Programmseiten
CI Feature / test (push) Successful in 4m41s
Deploy Test / test (push) Successful in 4m42s
Deploy Test / deploy (push) Successful in 26s

Der Grundstil setzt list-style zurück; die Container für formatierten Text
setzen disc und decimal nun ausdrücklich.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
LarsandClaude Sonnet 5.5 committed 2026-11-30 18:13:55 +01:00
1 parent 66f9275099
commit 67764c3e4f
9 files changed
+92 -2

No files matched your search

+47
View File
@@ -0,0 +1,47 @@
<?php
namespace Tests\Feature;
use Tests\TestCase;
/**
* Aufzählungszeichen und Nummern im formatierten Text: Der Grundstil (Tailwind) setzt list-style zurück, deshalb muss jeder
* Container, in dem formatierter Text der Redaktion erscheint, die Listenarten ausdrücklich setzen. Das Verhalten ist CSS;
* geprüft wird, dass jeder Container eine Regel für ul (disc) und ol (decimal) hat.
*/
class RichTextListsTest extends TestCase
{
private function css(string $file): string
{
return (string) file_get_contents(resource_path('css/'.$file));
}
public function test_every_container_for_formatted_text_sets_both_list_styles(): void
{
$widgets = $this->css('widgets.css');
// Text, Überschrift, Karten, Hinweis (Klasse .prose im Widget)
$this->assertMatchesRegularExpression('/\.widget-prose[^{]*\.prose ul \{ list-style: disc; \}/', $widgets);
$this->assertMatchesRegularExpression('/\.widget-prose[^{]*\.prose ol \{ list-style: decimal; \}/', $widgets);
// Bild und Text
$imageText = $this->css('components/lf-bild-text.css');
$this->assertStringContainsString('.lf-bt__body ul { list-style: disc; }', $imageText);
$this->assertStringContainsString('.lf-bt__body ol { list-style: decimal; }', $imageText);
// Shop- und Programmseiten
$base = $this->css('base.css');
foreach (['.shop-description', '.lede', '.rich-lists'] as $container) {
$this->assertStringContainsString($container, $base);
}
$this->assertStringContainsString(') ul { list-style: disc; }', $base);
$this->assertStringContainsString(') ol { list-style: decimal; }', $base);
}
public function test_the_public_catalog_pages_mark_their_goal_text(): void
{
foreach (['program', 'article'] as $view) {
$this->assertStringContainsString('<div class="rich-lists"><strong>Lernziel:</strong>', (string) file_get_contents(resource_path('views/public/'.$view.'.blade.php')), $view);
}
}
}