Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
22 changes: 11 additions & 11 deletions tests/Browser/AllowNewTest/AllowNewTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

class AllowNewTest extends TestCase
{
/** @test */
#[\PHPUnit\Framework\Attributes\Test]
public function add_new_row_is_not_shown_when_there_is_no_input()
{
Livewire::visit(AddNewItemComponent::class)
Expand All @@ -18,7 +18,7 @@ public function add_new_row_is_not_shown_when_there_is_no_input()
;
}

/** @test */
#[\PHPUnit\Framework\Attributes\Test]
public function add_new_row_appears_when_allow_new_is_true_and_text_is_entered()
{
Livewire::visit(AddNewItemComponent::class)
Expand All @@ -31,7 +31,7 @@ public function add_new_row_appears_when_allow_new_is_true_and_text_is_entered()
;
}

/** @test */
#[\PHPUnit\Framework\Attributes\Test]
public function add_new_row_is_visible_when_no_results_found()
{
Livewire::visit(AddNewItemComponent::class)
Expand All @@ -44,7 +44,7 @@ public function add_new_row_is_visible_when_no_results_found()
;
}

/** @test */
#[\PHPUnit\Framework\Attributes\Test]
public function first_result_should_be_highlighted_when_add_new_row_not_displayed_yet()
{
Livewire::visit(AddNewItemComponent::class)
Expand All @@ -55,7 +55,7 @@ public function first_result_should_be_highlighted_when_add_new_row_not_displaye
;
}

/** @test */
#[\PHPUnit\Framework\Attributes\Test]
public function add_new_row_should_be_highlighed_by_default()
{
Livewire::visit(AddNewItemComponent::class)
Expand All @@ -67,7 +67,7 @@ public function add_new_row_should_be_highlighed_by_default()
;
}

/** @test */
#[\PHPUnit\Framework\Attributes\Test]
public function add_new_row_should_be_highlighed_after_arrowing_down_and_back_up()
{
Livewire::visit(AddNewItemComponent::class)
Expand All @@ -87,7 +87,7 @@ public function add_new_row_should_be_highlighed_after_arrowing_down_and_back_up
;
}

/** @test */
#[\PHPUnit\Framework\Attributes\Test]
public function first_result_should_be_selected_when_add_new_row_not_displayed_yet()
{
Livewire::visit(AddNewItemComponent::class)
Expand All @@ -100,7 +100,7 @@ public function first_result_should_be_selected_when_add_new_row_not_displayed_y
;
}

/** @test */
#[\PHPUnit\Framework\Attributes\Test]
public function add_new_row_should_be_selected_but_nothing_happen()
{
Livewire::visit(AddNewItemComponent::class)
Expand All @@ -116,7 +116,7 @@ public function add_new_row_should_be_selected_but_nothing_happen()
;
}

/** @test */
#[\PHPUnit\Framework\Attributes\Test]
public function highlighted_record_should_be_selected_even_when_add_new_row_displayed()
{
Livewire::visit(AddNewItemComponent::class)
Expand All @@ -131,7 +131,7 @@ public function highlighted_record_should_be_selected_even_when_add_new_row_disp
;
}

/** @test */
#[\PHPUnit\Framework\Attributes\Test]
public function escape_does_not_clear_the_input_when_add_new_allowed()
{
Livewire::visit(AddNewItemComponent::class)
Expand All @@ -146,7 +146,7 @@ public function escape_does_not_clear_the_input_when_add_new_allowed()
;
}

/** @test */
#[\PHPUnit\Framework\Attributes\Test]
public function clicking_away_does_not_clear_the_input_when_add_new_allowed()
{
Livewire::visit(AddNewItemComponent::class)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@

class AutocompleteBehaviourTest extends TestCase
{
/** @test */
#[\PHPUnit\Framework\Attributes\Test]
public function an_input_is_shown_on_screen()
{
Livewire::visit(PageWithAutocompleteComponent::class)
->assertPresent('@autocomplete-input')
;
}

/** @test */
#[\PHPUnit\Framework\Attributes\Test]
public function dropdown_appears_when_input_is_focused()
{
Livewire::visit(PageWithAutocompleteComponent::class)
Expand All @@ -27,7 +27,7 @@ public function dropdown_appears_when_input_is_focused()
;
}

/** @test */
#[\PHPUnit\Framework\Attributes\Test]
public function dropdown_closes_when_anything_else_is_clicked_and_focus_is_removed()
{
Livewire::visit(PageWithAutocompleteComponent::class)
Expand All @@ -43,7 +43,7 @@ public function dropdown_closes_when_anything_else_is_clicked_and_focus_is_remov
;
}

/** @test */
#[\PHPUnit\Framework\Attributes\Test]
public function dropdown_closes_when_escape_is_pressed_and_focus_removed()
{
Livewire::visit(PageWithAutocompleteComponent::class)
Expand All @@ -59,7 +59,7 @@ public function dropdown_closes_when_escape_is_pressed_and_focus_removed()
;
}

/** @test */
#[\PHPUnit\Framework\Attributes\Test]
public function dropdown_shows_list_of_results()
{
Livewire::visit(PageWithAutocompleteComponent::class)
Expand All @@ -73,7 +73,7 @@ public function dropdown_shows_list_of_results()
;
}

/** @test */
#[\PHPUnit\Framework\Attributes\Test]
public function results_are_filtered_based_on_input()
{
Livewire::visit(PageWithAutocompleteComponent::class)
Expand All @@ -87,7 +87,7 @@ public function results_are_filtered_based_on_input()
;
}

/** @test */
#[\PHPUnit\Framework\Attributes\Test]
public function down_arrow_focus_first_option_if_there_is_no_focus_in_dropdown()
{
Livewire::visit(PageWithAutocompleteComponent::class)
Expand All @@ -102,7 +102,7 @@ public function down_arrow_focus_first_option_if_there_is_no_focus_in_dropdown()
;
}

/** @test */
#[\PHPUnit\Framework\Attributes\Test]
public function down_arrow_focus_next_option_if_there_is_already_a_focus_in_dropdown()
{
Livewire::visit(PageWithAutocompleteComponent::class)
Expand All @@ -115,7 +115,7 @@ public function down_arrow_focus_next_option_if_there_is_already_a_focus_in_drop
;
}

/** @test */
#[\PHPUnit\Framework\Attributes\Test]
public function down_arrow_focus_remains_on_last_result_in_dropdown()
{
Livewire::visit(PageWithAutocompleteComponent::class)
Expand All @@ -133,7 +133,7 @@ public function down_arrow_focus_remains_on_last_result_in_dropdown()
;
}

/** @test */
#[\PHPUnit\Framework\Attributes\Test]
public function up_arrow_clears_focus_if_first_option_is_focused_in_dropdown()
{
Livewire::visit(PageWithAutocompleteComponent::class)
Expand All @@ -149,7 +149,7 @@ public function up_arrow_clears_focus_if_first_option_is_focused_in_dropdown()
;
}

/** @test */
#[\PHPUnit\Framework\Attributes\Test]
public function up_arrow_focuses_previous_option_if_there_is_another_option_before_current_in_dropdown()
{
Livewire::visit(PageWithAutocompleteComponent::class)
Expand All @@ -166,7 +166,7 @@ public function up_arrow_focuses_previous_option_if_there_is_another_option_befo
;
}

/** @test */
#[\PHPUnit\Framework\Attributes\Test]
public function up_arrow_focuses_nothing_if_nothing_currently_focused_in_dropdown()
{
Livewire::visit(PageWithAutocompleteComponent::class)
Expand All @@ -181,7 +181,7 @@ public function up_arrow_focuses_nothing_if_nothing_currently_focused_in_dropdow
;
}

/** @test */
#[\PHPUnit\Framework\Attributes\Test]
public function home_key_focuses_first_result_in_dropdown()
{
Livewire::visit(PageWithAutocompleteComponent::class)
Expand All @@ -208,7 +208,7 @@ public function home_key_focuses_first_result_in_dropdown()
;
}

/** @test */
#[\PHPUnit\Framework\Attributes\Test]
public function end_key_focuses_last_result_in_dropdown()
{
Livewire::visit(PageWithAutocompleteComponent::class)
Expand All @@ -235,7 +235,7 @@ public function end_key_focuses_last_result_in_dropdown()
;
}

/** @test */
#[\PHPUnit\Framework\Attributes\Test]
public function focus_is_cleared_if_input_changes()
{
Livewire::visit(PageWithAutocompleteComponent::class)
Expand All @@ -251,7 +251,7 @@ public function focus_is_cleared_if_input_changes()
;
}

/** @test */
#[\PHPUnit\Framework\Attributes\Test]
public function enter_key_selects_currently_focused_result()
{
Livewire::visit(PageWithAutocompleteComponent::class)
Expand All @@ -266,7 +266,7 @@ public function enter_key_selects_currently_focused_result()
;
}

/** @test */
#[\PHPUnit\Framework\Attributes\Test]
public function enter_key_only_selects_if_there_is_a_currently_focused_result()
{
Livewire::visit(PageWithAutocompleteComponent::class)
Expand All @@ -280,7 +280,7 @@ public function enter_key_only_selects_if_there_is_a_currently_focused_result()
;
}

/** @test */
#[\PHPUnit\Framework\Attributes\Test]
public function enter_key_submits_form_if_there_is_not_a_currently_focused_result()
{
Livewire::visit(PageWithAutocompleteInFormComponent::class)
Expand All @@ -293,7 +293,7 @@ public function enter_key_submits_form_if_there_is_not_a_currently_focused_resul
;
}

/** @test */
#[\PHPUnit\Framework\Attributes\Test]
public function enter_key_does_not_submit_form_if_there_is_a_currently_focused_result()
{
Livewire::visit(PageWithAutocompleteInFormComponent::class)
Expand All @@ -307,7 +307,7 @@ public function enter_key_does_not_submit_form_if_there_is_a_currently_focused_r
;
}

/** @test */
#[\PHPUnit\Framework\Attributes\Test]
public function dropdown_is_hidden_and_focus_cleared_on_selection()
{
Livewire::visit(PageWithAutocompleteComponent::class)
Expand All @@ -326,7 +326,7 @@ public function dropdown_is_hidden_and_focus_cleared_on_selection()
;
}

/** @test */
#[\PHPUnit\Framework\Attributes\Test]
public function tab_key_selects_currently_focused_result()
{
Livewire::visit(PageWithAutocompleteComponent::class)
Expand All @@ -340,7 +340,7 @@ public function tab_key_selects_currently_focused_result()
;
}

/** @test */
#[\PHPUnit\Framework\Attributes\Test]
public function tab_key_only_selects_if_there_is_a_currently_focused_result()
{
Livewire::visit(PageWithAutocompleteComponent::class)
Expand All @@ -354,7 +354,7 @@ public function tab_key_only_selects_if_there_is_a_currently_focused_result()
;
}

/** @test */
#[\PHPUnit\Framework\Attributes\Test]
public function shift_tab_does_not_select_currently_focused_result()
{
Livewire::visit(PageWithAutocompleteComponent::class)
Expand All @@ -369,7 +369,7 @@ public function shift_tab_does_not_select_currently_focused_result()
;
}

/** @test */
#[\PHPUnit\Framework\Attributes\Test]
public function mouse_hover_focuses_result()
{
Livewire::visit(PageWithAutocompleteComponent::class)
Expand All @@ -391,7 +391,7 @@ public function mouse_hover_focuses_result()
;
}

/** @test */
#[\PHPUnit\Framework\Attributes\Test]
public function mouse_leave_clears_focus_result()
{
Livewire::visit(PageWithAutocompleteComponent::class)
Expand All @@ -410,7 +410,7 @@ public function mouse_leave_clears_focus_result()
;
}

/** @test */
#[\PHPUnit\Framework\Attributes\Test]
public function mouse_click_selects_result()
{
Livewire::visit(PageWithAutocompleteComponent::class)
Expand All @@ -420,7 +420,7 @@ public function mouse_click_selects_result()
;
}

/** @test */
#[\PHPUnit\Framework\Attributes\Test]
public function selected_result_shown_in_input()
{
Livewire::visit(PageWithAutocompleteComponent::class)
Expand All @@ -430,7 +430,7 @@ public function selected_result_shown_in_input()
;
}

/** @test */
#[\PHPUnit\Framework\Attributes\Test]
public function mouse_click_only_fires_once_on_newly_generated_morphed_results()
{
// This is a bug in livewire/livewire#763, this test triggers it without work around
Expand All @@ -448,7 +448,7 @@ public function mouse_click_only_fires_once_on_newly_generated_morphed_results()
;
}

/** @test */
#[\PHPUnit\Framework\Attributes\Test]
public function using_shift_does_not_clear_input()
{
// This bug has been fixed, but for some reason the test still fails, while a manual test confirms it is ok. Leaving here for future reference.
Expand All @@ -466,7 +466,7 @@ public function using_shift_does_not_clear_input()
;
}

/** @test */
#[\PHPUnit\Framework\Attributes\Test]
public function input_does_not_get_overridden_when_multiple_network_requests_are_sent()
{
Livewire::visit(PageWithNetworkDelayComponent::class)
Expand Down Expand Up @@ -499,7 +499,7 @@ public function input_does_not_get_overridden_when_multiple_network_requests_are
;
}

/** @test */
#[\PHPUnit\Framework\Attributes\Test]
public function pre_selected_value_is_shown_in_input()
{
Livewire::visit(PageWithPreSelectedValueComponent::class)
Expand All @@ -512,7 +512,7 @@ public function pre_selected_value_is_shown_in_input()
;
}

/** @test */
#[\PHPUnit\Framework\Attributes\Test]
public function pre_selected_value_can_be_changed_from_other_backend_actions()
{
Livewire::visit(PageWithPreSelectedValueComponent::class)
Expand Down
Loading