Skip to content
This repository was archived by the owner on Jan 2, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
L10 fixes
  • Loading branch information
pascalbaljet committed Feb 21, 2023
commit da4f67d5bc62b33f06b22242d965af883eb50681
8 changes: 4 additions & 4 deletions tests/Feature/LivewireTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,8 @@ public function it_can_validate_the_fields()
->assertSeeHtml('The textarea field is required')
->assertSeeHtml('The select field is required')
->assertSeeHtml('The multi select field is required')
->assertSeeHtml('The checkbox must be accepted')
->assertSeeHtml('The radio must be accepted');
->assertSeeHtml(TestCase::isLaravel10() ? 'The checkbox field must be accepted' : 'The checkbox must be accepted')
->assertSeeHtml(TestCase::isLaravel10() ? 'The radio field must be accepted' : 'The radio must be accepted');
}

/** @test */
Expand All @@ -125,8 +125,8 @@ public function it_can_add_a_modifier_to_the_wire_directive()
->assertSeeHtml('The textarea field is required')
->assertSeeHtml('The select field is required')
->assertSeeHtml('The multi select field is required')
->assertSeeHtml('The checkbox must be accepted')
->assertSeeHtml('The radio must be accepted');
->assertSeeHtml(TestCase::isLaravel10() ? 'The checkbox field must be accepted' : 'The checkbox must be accepted')
->assertSeeHtml(TestCase::isLaravel10() ? 'The radio field must be accepted' : 'The radio must be accepted');
}

/** @test */
Expand Down
2 changes: 1 addition & 1 deletion tests/Feature/MultipleSelectTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ public function it_posts_all_selected_options()
->press('Submit')
->seeElement('option[value="be"]:selected')
->seeElement('option[value="nl"]:selected')
->seeText('The select must be a string.');
->seeText(static::isLaravel10() ? 'The select field must be a string.' : 'The select must be a string.');
}
}
4 changes: 2 additions & 2 deletions tests/Feature/TranslationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public function it_shows_the_validation_errors_and_old_values_correctly()
->press('Submit')
->seeElement('input[name="input[nl]"][value="hoi"]')
->seeElement('input[name="input[en]"][value="hey"]')
->seeText('The input.nl must be at least 5 characters')
->seeText('The input.en must be at least 5 characters');
->seeText(static::isLaravel10() ? 'The input.nl field must be at least 5 characters' : 'The input.nl must be at least 5 characters')
->seeText(static::isLaravel10() ? 'The input.en field must be at least 5 characters' : 'The input.en must be at least 5 characters');
}
}
5 changes: 5 additions & 0 deletions tests/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ abstract class TestCase extends BaseTestCase
{
protected $baseUrl = 'http://localhost';

public static function isLaravel10(): bool
{
return version_compare(app()->version(), '10.0', '>=');
}

public function setUp(): void
{
parent::setUp();
Expand Down