Skip to content

Commit

Permalink
Fix other flaky tests by removing the clickAtXPath on the body and us…
Browse files Browse the repository at this point in the history
…e a different element
  • Loading branch information
joshhanley committed Jan 18, 2024
1 parent 1f856af commit 3adf311
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions tests/Browser/AutoSelectTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ public function render()
{
return <<< 'HTML'
<div>
<p dusk="some-element-other-than-the-input">some-element-other-than-the-input</p>
<x-autocomplete auto-select wire:model.live="selected">
<x-autocomplete-input wire:model.live="input" dusk="input" />
Expand Down Expand Up @@ -240,7 +241,7 @@ public function on_autoselect_click_away_clears_input_text()
// Pause to allow transitions to run
->pause(100)
->waitForLivewire()->type('@input', 'steve')
->waitForLivewire()->clickAtXPath('//body')
->waitForLivewire()->click('@some-element-other-than-the-input')
->assertValue('@input', '')
;
}
Expand All @@ -254,7 +255,7 @@ public function on_autoselect_click_away_does_not_clear_selected_text()
->pause(100)
->waitForLivewire()->click('@result-0')
->assertValue('@input', 'bob')
->clickAtXPath('//body')
->click('@some-element-other-than-the-input')
->assertValue('@input', 'bob')
;
}
Expand All @@ -270,7 +271,7 @@ public function on_autoselect_click_away_does_not_clear_input_value_if_new_item_
->keys('@input', '{ARROW_DOWN}')
->assertHasClass('@add-new', 'bg-blue-500')
->assertValue('@input', 'steve')
->clickAtXPath('//body')
->click('@some-element-other-than-the-input')
->assertValue('@input', 'steve')
;
}
Expand Down

0 comments on commit 3adf311

Please sign in to comment.