test element rich text

This commit is contained in:
Yisroel Baum 2026-05-27 19:57:12 +03:00
parent ef54aa97aa
commit 827abde41b
Signed by: yisroelbaum
GPG key ID: 0FA60884F75520A9
8 changed files with 69 additions and 1 deletions

View file

@ -30,18 +30,21 @@ class ElementControllerTest extends TestCase
$set,
'Baderech HaAvodah',
'A structured path for growth',
'<p>A structured path for growth</p>',
null,
);
$firstChildElement = $this->createElement(
$set,
'Avodah Foundations',
'Foundations for steady avodah',
'<p>Foundations rich text</p>',
$element,
);
$secondChildElement = $this->createElement(
$set,
'Daily Practice',
'Daily practices for growth',
'<p>Daily practice rich text</p>',
$element,
);
@ -55,6 +58,10 @@ class ElementControllerTest extends TestCase
'A structured path for growth',
$body['element']['description'],
);
$this->assertSame(
'<p>A structured path for growth</p>',
$body['element']['richText'],
);
$this->assertSame([
[
'id' => $firstChildElement->getId(),
@ -105,12 +112,14 @@ class ElementControllerTest extends TestCase
DomainSet $set,
string $title,
string $description,
string $richText,
?Element $parentElement,
): Element {
return $this->elementRepo->create(new CreateElementDto(
set: $set,
title: $title,
description: $description,
richText: $richText,
parentElement: $parentElement,
));
}