Skip to content

Commit

Permalink
update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
2amjsouza committed Sep 15, 2023
1 parent e767501 commit 8754f61
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 14 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* PHP 8.1+
* Imagick
* GD
* npm 16.+

### Install

Expand Down
6 changes: 3 additions & 3 deletions app/Factories/QrCodeFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ class QrCodeFactory
*/
public static function build(int $format, array $content): ?QrCodeInterface
{
try {
$format = FormatEnum::tryFrom($format);
} catch (Exception $exception) {
$format = FormatEnum::tryFrom($format);

if (is_null($format)) {
throw new Exception('Format must be enum of ' . FormatEnum::class);
}

Expand Down
11 changes: 0 additions & 11 deletions tests/Unit/Livewire/Traits/OptionsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ public function test_apply_label()
->set('align', '')
->call('applyLabel')
->assertHasErrors([
'label',
'size',
'align'
])
Expand Down Expand Up @@ -87,14 +86,4 @@ public function test_apply_margin()
->assertHasErrors(['margins'])
->assertNotDispatched('apply-margin');
}

public function test_toogle_option_form()
{
Livewire::test(QrCodeBuilder::class, [FormatEnum::Text->value])
->call('toggleOption', OptionsEnum::Label->value)
->call('toggleOption', OptionsEnum::Colors->value)
->call('toggleOption', OptionsEnum::Margin->value)
->call('toggleOption', OptionsEnum::Logo->value)
->assertHasNoErrors();
}
}

0 comments on commit 8754f61

Please sign in to comment.