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

@ -32,6 +32,7 @@ class ElementControllerTest 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,
);
$firstChildElement = $this->createElement(
@ -40,6 +41,7 @@ class ElementControllerTest extends TestCase
'Foundations for steady avodah',
'<p>Foundations rich text</p>',
'/assets/pdfs/foundations.pdf',
null,
$element,
);
$secondChildElement = $this->createElement(
@ -48,6 +50,7 @@ class ElementControllerTest extends TestCase
'Daily practices for growth',
'<p>Daily practice rich text</p>',
null,
null,
$element,
);
@ -69,6 +72,10 @@ class ElementControllerTest extends TestCase
'/assets/pdfs/baderech.pdf',
$body['element']['pdfPath'],
);
$this->assertSame(
'https://www.youtube.com/watch?v=yHx-r4p6hHU&t=1s',
$body['element']['youtubeUrl'],
);
$this->assertSame([
[
'id' => $firstChildElement->getId(),
@ -121,6 +128,7 @@ class ElementControllerTest extends TestCase
string $description,
string $richText,
?string $pdfPath,
?string $youtubeUrl,
?Element $parentElement,
): Element {
return $this->elementRepo->create(new CreateElementDto(
@ -129,6 +137,7 @@ class ElementControllerTest extends TestCase
description: $description,
richText: $richText,
pdfPath: $pdfPath,
youtubeUrl: $youtubeUrl,
parentElement: $parentElement,
));
}