Skip to content

Commit

Permalink
Merge branch '10.5'
Browse files Browse the repository at this point in the history
  • Loading branch information
crynobone committed Jul 24, 2024
2 parents b798097 + d3fbab7 commit da1e11d
Show file tree
Hide file tree
Showing 59 changed files with 205 additions and 194 deletions.
1 change: 1 addition & 0 deletions lang/vendor/nova/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -469,6 +469,7 @@
"Copy to clipboard": "Copy to clipboard",
"Are you sure you want to delete this notification?": "Are you sure you want to delete this notification?",
"The image could not be loaded": "The image could not be loaded",
"Export As CSV": "Export As CSV",
"Filename": "Filename",
"Type": "Type",
"CSV (.csv)": "CSV (.csv)",
Expand Down
8 changes: 4 additions & 4 deletions tests/Browser/ActionFieldTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public function test_actions_modal_shouldnt_closed_when_user_using_shortcut()
->clickCheckboxForId(1)
->selectAction('update-pivot-notes', function ($browser) {
$browser->elsewhere('', function ($browser) {
$browser->whenAvailable(new ConfirmActionModalComponent(), function ($browser) {
$browser->whenAvailable(new ConfirmActionModalComponent, function ($browser) {
$browser->assertScript('Nova.useShortcuts', false)
->assertSee('Provide a description for notes.');
})->keys('', ['e']);
Expand All @@ -89,7 +89,7 @@ public function test_actions_can_be_validated()
$browser->waitForTable()
->clickCheckboxForId(1)
->runAction('update-required-pivot-notes')
->elsewhere(new ConfirmActionModalComponent(), function ($browser) {
->elsewhere(new ConfirmActionModalComponent, function ($browser) {
$browser->assertSee(__('validation.required', ['attribute' => 'Notes']));
});
});
Expand Down Expand Up @@ -137,13 +137,13 @@ public function test_actions_cant_be_executed_when_not_authorized_to_run()
->within(new IndexComponent('users'), function (Browser $browser) {
$browser->waitForTable()
->openControlSelectorById(1)
->elsewhereWhenAvailable(new ActionDropdownComponent(), function (Browser $browser) {
->elsewhereWhenAvailable(new ActionDropdownComponent, function (Browser $browser) {
$browser->waitFor('@1-preview-button')
->assertMissing('@1-inline-actions');
})
->closeCurrentDropdown()
->openControlSelectorById(2)
->elsewhereWhenAvailable(new ActionDropdownComponent(), function (Browser $browser) {
->elsewhereWhenAvailable(new ActionDropdownComponent, function (Browser $browser) {
$browser->assertSee('Mark As Inactive');
});
});
Expand Down
4 changes: 2 additions & 2 deletions tests/Browser/ActionModalAbandonmentTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public function test_modal_shows_exit_warning_dialog_if_form_has_changes()
->clickCheckboxForId(1)
->selectAction('update-required-pivot-notes', function ($browser) {
$browser->elsewhere('', function ($browser) {
$browser->whenAvailable(new ConfirmActionModalComponent(), function ($browser) {
$browser->whenAvailable(new ConfirmActionModalComponent, function ($browser) {
$browser->keys('@notes', 'Custom Notes', '{tab}');
})
->assertPresentModal()
Expand Down Expand Up @@ -56,7 +56,7 @@ public function test_it_doesnt_show_exit_warning_if_modal_has_changes_when_click
$browser->waitForTable()
->clickCheckboxForId(1)
->selectAction('update-required-pivot-notes', function ($browser) {
$browser->elsewhereWhenAvailable(new ConfirmActionModalComponent(), function ($browser) {
$browser->elsewhereWhenAvailable(new ConfirmActionModalComponent, function ($browser) {
$browser->type('@notes', 'Custom Notes')->cancel();
})
->pause(100)
Expand Down
6 changes: 3 additions & 3 deletions tests/Browser/AttachDuplicationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public function test_it_cant_attach_different_unique_relation()

$browser->loginAs(1)
->visit(Attach::belongsToMany('users', 1, 'roles'))
->within(new FormComponent(), function ($browser) use ($role) {
->within(new FormComponent, function ($browser) use ($role) {
$browser->whenAvailable('@via-resource-field', function ($browser) {
$browser->assertSee('User')->assertSee('Taylor Otwell');
})
Expand Down Expand Up @@ -60,7 +60,7 @@ public function test_it_can_attach_different_relation_groups()
$browser->loginAs(1)
->visit(Attach::belongsToMany('users', 1, 'books', 'giftBooks'))
->assertSeeIn('h1', 'Attach Book')
->within(new FormComponent(), function ($browser) use ($now) {
->within(new FormComponent, function ($browser) use ($now) {
$browser->selectAttachable(4)
->type('@price', '39')
->typeOnDateTimeLocal('input[dusk="purchased_at"]', $now);
Expand Down Expand Up @@ -101,7 +101,7 @@ public function test_it_can_attach_duplicate_relations_with_different_pivot()
$browser->loginAs(1)
->visit(Attach::belongsToMany('users', 1, 'books', 'personalBooks'))
->assertSeeIn('h1', 'Attach Book')
->within(new FormComponent(), function ($browser) use ($now) {
->within(new FormComponent, function ($browser) use ($now) {
$browser->selectAttachable(4)
->type('@price', '34')
->typeOnDateTimeLocal('input[dusk="purchased_at"]', $now);
Expand Down
20 changes: 10 additions & 10 deletions tests/Browser/AttachPolymorphicTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@ public function test_non_searchable_resource_can_be_attached()
->click('@attach-button');
})
->on(Attach::morphToMany('posts', $post->id, 'tags'))
->within(new BreadcrumbComponent(), function ($browser) use ($post) {
->within(new BreadcrumbComponent, function ($browser) use ($post) {
$browser->assertSeeLink('User Post')
->assertSeeLink("User Post Details: {$post->id}")
->assertCurrentPageTitle('Attach Tag');
})

->within(new FormComponent(), function ($browser) use ($tag) {
->within(new FormComponent, function ($browser) use ($tag) {
$browser->searchFirstRelation('tags', $tag->id);
})
->create()
Expand Down Expand Up @@ -64,12 +64,12 @@ public function test_searchable_resource_can_be_attached()
->click('@attach-button');
})
->on(Attach::morphToMany('posts', $post->id, 'tags'))
->within(new BreadcrumbComponent(), function ($browser) use ($post) {
->within(new BreadcrumbComponent, function ($browser) use ($post) {
$browser->assertSeeLink('User Post')
->assertSeeLink("User Post Details: {$post->id}")
->assertCurrentPageTitle('Attach Tag');
})
->within(new FormComponent(), function ($browser) use ($tag) {
->within(new FormComponent, function ($browser) use ($tag) {
$browser->searchFirstRelation('tags', $tag->id);
})
->create()
Expand All @@ -93,12 +93,12 @@ public function test_fields_on_intermediate_table_should_be_stored()

$browser->loginAs(1)
->visit(Attach::morphToMany('posts', $post->id, 'tags'))
->within(new BreadcrumbComponent(), function ($browser) use ($post) {
->within(new BreadcrumbComponent, function ($browser) use ($post) {
$browser->assertSeeLink('User Post')
->assertSeeLink("User Post Details: {$post->id}")
->assertCurrentPageTitle('Attach Tag');
})
->within(new FormComponent(), function ($browser) use ($tag) {
->within(new FormComponent, function ($browser) use ($tag) {
$browser->searchFirstRelation('tags', $tag->id)
->type('@notes', 'Test Notes');
})
Expand All @@ -122,12 +122,12 @@ public function test_validation_errors_are_displayed()

$browser->loginAs(1)
->visit(Attach::morphToMany('posts', $post->id, 'tags'))
->within(new BreadcrumbComponent(), function ($browser) use ($post) {
->within(new BreadcrumbComponent, function ($browser) use ($post) {
$browser->assertSeeLink('User Post')
->assertSeeLink("User Post Details: {$post->id}")
->assertCurrentPageTitle('Attach Tag');
})
->within(new FormComponent(), function ($browser) {
->within(new FormComponent, function ($browser) {
$browser->whenAvailable('@notes', function ($browser) {
$browser->type('', str_repeat('A', 30));
});
Expand Down Expand Up @@ -155,12 +155,12 @@ public function test_validation_errors_are_displayed_for_pivot_fields()

$browser->loginAs(1)
->visit(Attach::morphToMany('posts', $post->id, 'tags'))
->within(new BreadcrumbComponent(), function ($browser) use ($post) {
->within(new BreadcrumbComponent, function ($browser) use ($post) {
$browser->assertSeeLink('User Post')
->assertSeeLink("User Post Details: {$post->id}")
->assertCurrentPageTitle('Attach Tag');
})
->within(new FormComponent(), function ($browser) use ($tag) {
->within(new FormComponent, function ($browser) use ($tag) {
$browser->searchFirstRelation('tags', $tag->id)
->type('@notes', str_repeat('A', 30));
})
Expand Down
4 changes: 3 additions & 1 deletion tests/Browser/AttachResourceFormAbandonmentTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
use Laravel\Nova\Testing\Browser\Pages\Detail;
use Laravel\Nova\Testing\Browser\Pages\UserIndex;
use Laravel\Nova\Tests\DuskTestCase;
use PHPUnit\Framework\Attributes\Group;

#[Group('form-abort')]
class AttachResourceFormAbandonmentTest extends DuskTestCase
{
public function test_it_shows_exit_warning_if_resource_form_has_changes_when_navigating_to_different_page()
Expand All @@ -23,7 +25,7 @@ public function test_it_shows_exit_warning_if_resource_form_has_changes_when_nav
$browser->assertSee('User')->assertSee('Taylor Otwell');
})
->keys('@notes', 'Test Notes', '{tab}')
->within(new SidebarComponent(), function ($browser) {
->within(new SidebarComponent, function ($browser) {
$browser->clickLink('Users');
})
->waitForDialog()
Expand Down
16 changes: 8 additions & 8 deletions tests/Browser/AttachSoftDeletingTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ public function test_non_searchable_resource_can_be_attached()

$browser->loginAs(1)
->visit(Attach::belongsToMany('captains', $captain->id, 'ships'))
->within(new BreadcrumbComponent(), function ($browser) use ($captain) {
->within(new BreadcrumbComponent, function ($browser) use ($captain) {
$browser->assertSeeLink('Captains')
->assertSeeLink('Captain Details: '.$captain->id)
->assertCurrentPageTitle('Attach Ship');
})
->within(new FormComponent(), function ($browser) use ($ship) {
->within(new FormComponent, function ($browser) use ($ship) {
$browser->searchFirstRelation('ships', $ship->id);
})
->create()
Expand All @@ -51,12 +51,12 @@ public function test_with_trashed_checkbox_is_respected_and_non_searchable_soft_

$browser->loginAs(1)
->visit(Attach::belongsToMany('captains', $captain->id, 'ships'))
->within(new BreadcrumbComponent(), function ($browser) use ($captain) {
->within(new BreadcrumbComponent, function ($browser) use ($captain) {
$browser->assertSeeLink('Captains')
->assertSeeLink('Captain Details: '.$captain->id)
->assertCurrentPageTitle('Attach Ship');
})
->within(new FormComponent(), function ($browser) use ($ship) {
->within(new FormComponent, function ($browser) use ($ship) {
$browser->withTrashedRelation('ships')
->searchFirstRelation('ships', $ship->id);
})
Expand All @@ -83,12 +83,12 @@ public function test_searchable_resource_can_be_attached()

$browser->loginAs(1)
->visit(Attach::belongsToMany('captains', $captain->id, 'ships'))
->within(new BreadcrumbComponent(), function ($browser) use ($captain) {
->within(new BreadcrumbComponent, function ($browser) use ($captain) {
$browser->assertSeeLink('Captains')
->assertSeeLink('Captain Details: '.$captain->id)
->assertCurrentPageTitle('Attach Ship');
})
->within(new FormComponent(), function ($browser) use ($ship) {
->within(new FormComponent, function ($browser) use ($ship) {
$browser->searchFirstRelation('ships', $ship->id);
})
->create()
Expand All @@ -111,12 +111,12 @@ public function test_with_trashed_checkbox_is_respected_and_searchable_soft_dele

$browser->loginAs(1)
->visit(Attach::belongsToMany('captains', $captain->id, 'ships'))
->within(new BreadcrumbComponent(), function ($browser) use ($captain) {
->within(new BreadcrumbComponent, function ($browser) use ($captain) {
$browser->assertSeeLink('Captains')
->assertSeeLink('Captain Details: '.$captain->id)
->assertCurrentPageTitle('Attach Ship');
})
->within(new FormComponent(), function ($browser) use ($ship) {
->within(new FormComponent, function ($browser) use ($ship) {
$browser->withTrashedRelation('ships')
->searchFirstRelation('ships', $ship->id);
})
Expand Down
12 changes: 6 additions & 6 deletions tests/Browser/AttachTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public function test_resource_can_be_attached()

$browser->loginAs(1)
->visit(Attach::belongsToMany('users', 1, 'roles'))
->within(new FormComponent(), function ($browser) use ($role) {
->within(new FormComponent, function ($browser) use ($role) {
$browser->whenAvailable('@via-resource-field', function ($browser) {
$browser->assertSee('User')->assertSee('Taylor Otwell');
})
Expand Down Expand Up @@ -50,7 +50,7 @@ public function test_resource_can_be_attached_using_searchable()

$browser->loginAs(1)
->visit(Attach::belongsToMany('roles', $role->id, 'users'))
->within(new FormComponent(), function ($browser) use ($role) {
->within(new FormComponent, function ($browser) use ($role) {
$browser->whenAvailable('@via-resource-field', function ($browser) use ($role) {
$browser->assertSee('Role')->assertSee($role->id);
})
Expand All @@ -76,12 +76,12 @@ public function test_fields_on_intermediate_table_should_be_stored()

$browser->loginAs(1)
->visit(Attach::belongsToMany('users', 1, 'roles'))
->within(new BreadcrumbComponent(), function ($browser) {
->within(new BreadcrumbComponent, function ($browser) {
$browser->assertSeeLink('Users')
->assertSeeLink('User Details: Taylor Otwell')
->assertCurrentPageTitle('Attach Role');
})
->within(new FormComponent(), function ($browser) use ($role) {
->within(new FormComponent, function ($browser) use ($role) {
$browser->whenAvailable('@via-resource-field', function ($browser) {
$browser->assertSee('User')->assertSee('Taylor Otwell');
})
Expand Down Expand Up @@ -109,12 +109,12 @@ public function test_validation_errors_are_displayed()
$this->browse(function (Browser $browser) {
$browser->loginAs(1)
->visit(Attach::belongsToMany('users', 1, 'roles'))
->within(new BreadcrumbComponent(), function ($browser) {
->within(new BreadcrumbComponent, function ($browser) {
$browser->assertSeeLink('Users')
->assertSeeLink('User Details: Taylor Otwell')
->assertCurrentPageTitle('Attach Role');
})
->within(new FormComponent(), function ($browser) {
->within(new FormComponent, function ($browser) {
$browser->whenAvailable('@via-resource-field', function ($browser) {
$browser->assertSee('User')->assertSee('Taylor Otwell');
});
Expand Down
Loading

0 comments on commit da1e11d

Please sign in to comment.