Skip to content

Commit 694e921

Browse files
author
Khaled Sadek
committed
add basic test
1 parent 4258e80 commit 694e921

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

tests/AvatarTest.php

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<?php
2+
3+
namespace Tests;
4+
5+
use Orchestra\Testbench\TestCase as Orchestra;
6+
use KhaledSadek\BladeBoringAvatars\Components\Avatar;
7+
use Illuminate\Foundation\Testing\Concerns\InteractsWithViews;
8+
use KhaledSadek\BladeBoringAvatars\BladeBoringAvatarsServiceProvider;
9+
10+
class AvatarTest extends Orchestra
11+
{
12+
use InteractsWithViews;
13+
14+
protected function getPackageProviders($app)
15+
{
16+
return [
17+
BladeBoringAvatarsServiceProvider::class,
18+
];
19+
}
20+
21+
public function test_the_basic_component()
22+
{
23+
$view = $this->blade('<x-Avatar />');
24+
25+
$view->assertSee('width="40"', false)
26+
->assertSee('height="40"', false);
27+
}
28+
29+
public function test_the_size_option()
30+
{
31+
$view = $this->blade('<x-Avatar size="120" />');
32+
33+
$view->assertSee('width="120"', false)
34+
->assertSee('height="120"', false);
35+
}
36+
}

0 commit comments

Comments
 (0)