-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from chrisrhymes/placeholder-tests
Add placeholder tests
- Loading branch information
Showing
5 changed files
with
34 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<?php | ||
|
||
namespace Tests\Components; | ||
|
||
trait PlaceholderInputTests | ||
{ | ||
/** @test */ | ||
public function inputs_render_without_placeholder() | ||
{ | ||
$view = $this->withViewErrors([]) | ||
->blade( | ||
'<x-bbui::'.$this->component.' :label="$label" :name="$name" :options="$options"></x-bbui::'.$this->component.'>', | ||
['label' => 'The Input Label', 'name' => 'test', 'options' => ['first' => 'First option']] | ||
); | ||
|
||
$view->assertDontSee('placeholder'); | ||
} | ||
|
||
/** @test */ | ||
public function inputs_render_placeholder_when_set() | ||
{ | ||
$view = $this->withViewErrors([]) | ||
->blade( | ||
'<x-bbui::'.$this->component.' :label="$label" :name="$name" :options="$options" :placeholder="$placeholder"></x-bbui::'.$this->component.'>', | ||
['label' => 'The Input Label', 'name' => 'test', 'options' => ['first' => 'First option'], 'placeholder' => 'Enter some text'] | ||
); | ||
|
||
$view->assertSee('placeholder="Enter some text"', false); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters