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

@ -31,6 +31,7 @@ class GetElementTest extends TestCase
$set,
'Baderech HaAvodah',
'A structured path for growth',
'<p>A structured path for growth</p>',
null,
);
@ -46,6 +47,10 @@ class GetElementTest extends TestCase
'A structured path for growth',
$foundElement->getDescription(),
);
$this->assertSame(
'<p>A structured path for growth</p>',
$foundElement->getRichText(),
);
}
public function testReturnsDirectChildElements(): void
@ -55,24 +60,28 @@ class GetElementTest 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>',
$parentElement,
);
$secondChildElement = $this->createElement(
$set,
'Daily Practice',
'Daily practices for growth',
'<p>Daily practice rich text</p>',
$parentElement,
);
$this->createElement(
$set,
'Nested Practice',
'Nested description',
'<p>Nested rich text</p>',
$firstChildElement,
);
$otherSet = $this->createSet(2, 'Daily Learning');
@ -80,12 +89,14 @@ class GetElementTest extends TestCase
$otherSet,
'Other Parent',
'Other parent description',
'<p>Other parent rich text</p>',
null,
);
$this->createElement(
$otherSet,
'Other Child',
'Other child description',
'<p>Other child rich text</p>',
$otherParentElement,
);
@ -145,12 +156,14 @@ class GetElementTest 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,
));
}