File tree Expand file tree Collapse file tree
Modules/Core/Tests/Feature Expand file tree Collapse file tree Original file line number Diff line number Diff 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]
You can’t perform that action at this time.
0 commit comments