Skip to content

Commit 9be9bbf

Browse files
nielsdrost7Copilot
andcommitted
Update Modules/Core/Tests/Feature/ReportBuilderMasonIntegrationTest.php
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 103111a commit 9be9bbf

1 file changed

Lines changed: 12 additions & 2 deletions

File tree

Modules/Core/Tests/Feature/ReportBuilderMasonIntegrationTest.php

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,20 @@ public function it_saves_mason_content_to_filesystem(): void
5656
/* Act */
5757
$blocks = $this->adapter->masonToBlocks($masonJson);
5858
$this->service->persistBlocks($this->template, $blocks);
59+
$reloadedBlocks = $this->service->loadBlocks($this->template);
60+
$reloadedMasonJson = $this->adapter->blocksToMason($reloadedBlocks);
5961

6062
/* Assert */
61-
$path = "{$this->company->id}/{$this->template->slug}.json";
62-
Storage::disk('report_templates')->assertExists($path);
63+
$this->assertIsString($reloadedMasonJson);
64+
65+
$originalDecoded = json_decode($masonJson, true);
66+
$reloadedDecoded = json_decode($reloadedMasonJson, true);
67+
68+
$this->assertIsArray($originalDecoded);
69+
$this->assertIsArray($reloadedDecoded);
70+
$this->assertSame('doc', $originalDecoded['type']);
71+
$this->assertSame('doc', $reloadedDecoded['type']);
72+
$this->assertNotEmpty($reloadedDecoded['content']);
6373
}
6474

6575
#[Test]

0 commit comments

Comments
 (0)