Hallo Akzent!

'; $out = CmsFluxEditorHtmlTransformer::toEditor($html); expect($out)->toContain(''); expect($out)->toContain('Akzent'); expect($out)->not->toContain('text-secondary'); }); test('fromEditor wandelt mark in span text-secondary um', function () { $html = '

Hallo Akzent!

'; $out = CmsFluxEditorHtmlTransformer::fromEditor($html); expect($out)->toContain('class="text-secondary"'); expect($out)->toContain('Akzent'); expect($out)->not->toContain(''); }); test('Roundtrip erhält verschachtelte Formatierung', function () { $original = '

Fett und normal

'; $editor = CmsFluxEditorHtmlTransformer::toEditor($original); $saved = CmsFluxEditorHtmlTransformer::fromEditor($editor); expect($saved)->toContain('text-secondary'); expect($saved)->toContain('Fett'); }); test('JSON-Rich-Text-Felder werden für den Editor umgewandelt', function () { $items = [ [ 'title' => 'x', 'description' => '

Hinweis

', ], ]; $out = CmsFluxEditorHtmlTransformer::toEditorJsonItems($items, false); expect($out[0]['description'])->toContain(''); }); test('JSON-Rich-Text-Felder werden beim Speichern zurückgewandelt', function () { $items = [ [ 'description' => '

Hinweis

', ], ]; $out = CmsFluxEditorHtmlTransformer::fromEditorJsonItems($items, false); expect($out[0]['description'])->toContain('text-secondary'); });