test set media fields
This commit is contained in:
parent
c7b55b64ca
commit
1ce7688d33
2 changed files with 22 additions and 1 deletions
|
|
@ -16,9 +16,13 @@ class SetsEndpointTest extends TestCase
|
||||||
$setRepository = app(SetRepository::class);
|
$setRepository = app(SetRepository::class);
|
||||||
$baderechSet = $setRepository->create(new CreateSetDto(
|
$baderechSet = $setRepository->create(new CreateSetDto(
|
||||||
name: 'Baderech HaAvodah',
|
name: 'Baderech HaAvodah',
|
||||||
|
description: 'Baderech HaAvodah is a way of living',
|
||||||
|
iconImageUrl: '/assets/baderech-haavodah-icon.svg',
|
||||||
));
|
));
|
||||||
$dailyLearningSet = $setRepository->create(new CreateSetDto(
|
$dailyLearningSet = $setRepository->create(new CreateSetDto(
|
||||||
name: 'Daily Learning',
|
name: 'Daily Learning',
|
||||||
|
description: 'Daily learning for steady growth',
|
||||||
|
iconImageUrl: '/assets/daily-learning-icon.svg',
|
||||||
));
|
));
|
||||||
|
|
||||||
$response = $this->getJson('/api/sets');
|
$response = $this->getJson('/api/sets');
|
||||||
|
|
@ -29,10 +33,14 @@ class SetsEndpointTest extends TestCase
|
||||||
[
|
[
|
||||||
'id' => $baderechSet->getId(),
|
'id' => $baderechSet->getId(),
|
||||||
'name' => $baderechSet->getName(),
|
'name' => $baderechSet->getName(),
|
||||||
|
'description' => $baderechSet->getDescription(),
|
||||||
|
'iconImageUrl' => $baderechSet->getIconImageUrl(),
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'id' => $dailyLearningSet->getId(),
|
'id' => $dailyLearningSet->getId(),
|
||||||
'name' => $dailyLearningSet->getName(),
|
'name' => $dailyLearningSet->getName(),
|
||||||
|
'description' => $dailyLearningSet->getDescription(),
|
||||||
|
'iconImageUrl' => $dailyLearningSet->getIconImageUrl(),
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
]);
|
]);
|
||||||
|
|
|
||||||
|
|
@ -9,9 +9,22 @@ class SetTest extends TestCase
|
||||||
{
|
{
|
||||||
public function testCreatesSetWithName(): void
|
public function testCreatesSetWithName(): void
|
||||||
{
|
{
|
||||||
$set = new DomainSet(1, 'Daily learning');
|
$set = new DomainSet(
|
||||||
|
id: 1,
|
||||||
|
name: 'Daily learning',
|
||||||
|
description: 'A structured path for daily growth',
|
||||||
|
iconImageUrl: '/assets/daily-learning-icon.svg',
|
||||||
|
);
|
||||||
|
|
||||||
$this->assertSame(1, $set->getId());
|
$this->assertSame(1, $set->getId());
|
||||||
$this->assertSame('Daily learning', $set->getName());
|
$this->assertSame('Daily learning', $set->getName());
|
||||||
|
$this->assertSame(
|
||||||
|
'A structured path for daily growth',
|
||||||
|
$set->getDescription()
|
||||||
|
);
|
||||||
|
$this->assertSame(
|
||||||
|
'/assets/daily-learning-icon.svg',
|
||||||
|
$set->getIconImageUrl()
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue