File tree Expand file tree Collapse file tree 1 file changed +35
-0
lines changed Expand file tree Collapse file tree 1 file changed +35
-0
lines changed Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ namespace Tests \Unit \Components ;
4
+
5
+ use App \Http \Livewire \Documentation \GetStarted ;
6
+ use Illuminate \Support \Facades \Route ;
7
+ use Tests \TestCase ;
8
+
9
+ class CodeTest extends TestCase
10
+ {
11
+ public function setUp (): void
12
+ {
13
+ parent ::setUp ();
14
+
15
+ $ this ->fakeTorchlight ();
16
+ }
17
+
18
+ /** @test */
19
+ public function it_should_make_the_code_blocks ()
20
+ {
21
+ $ this ->blade ('<x-code language="php">echo "hello world";</x-code> ' )
22
+ ->assertSee ('<pre >##PRE_TL_COMPONENT##<code __torchlight-block ' , escape: false )
23
+ ->assertSee ('</code>##POST_TL_COMPONENT##</pre> ' , escape: false );
24
+ }
25
+
26
+ /** @test */
27
+ public function it_should_render_the_highlighted_code ()
28
+ {
29
+ Route::get ('test-code ' , GetStarted::class);
30
+
31
+ $ this ->get ('/test-code ' )
32
+ ->assertSee ('<pre ><code data-theme="material-theme-palenight" data-lang="shell" class="torchlight" style="background-color: #000000;"><div class="highlighted">// torchlight! {"lineNumbers":false} ' , escape: false )
33
+ ->assertSee ('composer require wireui/wireui</div></code></pre> ' , escape: false );
34
+ }
35
+ }
You can’t perform that action at this time.
0 commit comments