test element youtube url

This commit is contained in:
Yisroel Baum 2026-05-27 20:36:34 +03:00
parent 8a06f5a57c
commit f9c4d72e60
Signed by: yisroelbaum
GPG key ID: 0FA60884F75520A9
6 changed files with 75 additions and 0 deletions

View file

@ -33,6 +33,7 @@ class GetElementTest extends TestCase
'A structured path for growth',
'<p>A structured path for growth</p>',
'/assets/pdfs/baderech.pdf',
'https://www.youtube.com/watch?v=yHx-r4p6hHU&t=1s',
null,
);
@ -56,6 +57,10 @@ class GetElementTest extends TestCase
'/assets/pdfs/baderech.pdf',
$foundElement->getPdfPath(),
);
$this->assertSame(
'https://www.youtube.com/watch?v=yHx-r4p6hHU&t=1s',
$foundElement->getYoutubeUrl(),
);
}
public function testReturnsDirectChildElements(): void
@ -68,6 +73,7 @@ class GetElementTest extends TestCase
'<p>A structured path for growth</p>',
'/assets/pdfs/baderech.pdf',
null,
null,
);
$firstChildElement = $this->createElement(
$set,
@ -75,6 +81,7 @@ class GetElementTest extends TestCase
'Foundations for steady avodah',
'<p>Foundations rich text</p>',
'/assets/pdfs/foundations.pdf',
null,
$parentElement,
);
$secondChildElement = $this->createElement(
@ -83,6 +90,7 @@ class GetElementTest extends TestCase
'Daily practices for growth',
'<p>Daily practice rich text</p>',
null,
null,
$parentElement,
);
$this->createElement(
@ -91,6 +99,7 @@ class GetElementTest extends TestCase
'Nested description',
'<p>Nested rich text</p>',
null,
null,
$firstChildElement,
);
$otherSet = $this->createSet(2, 'Daily Learning');
@ -101,6 +110,7 @@ class GetElementTest extends TestCase
'<p>Other parent rich text</p>',
null,
null,
null,
);
$this->createElement(
$otherSet,
@ -108,6 +118,7 @@ class GetElementTest extends TestCase
'Other child description',
'<p>Other child rich text</p>',
null,
null,
$otherParentElement,
);
@ -169,6 +180,7 @@ class GetElementTest extends TestCase
string $description,
string $richText,
?string $pdfPath,
?string $youtubeUrl,
?Element $parentElement,
): Element {
return $this->elementRepo->create(new CreateElementDto(
@ -177,6 +189,7 @@ class GetElementTest extends TestCase
description: $description,
richText: $richText,
pdfPath: $pdfPath,
youtubeUrl: $youtubeUrl,
parentElement: $parentElement,
));
}