Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
ysfkaya committed Jul 24, 2024
1 parent 471e8fe commit bf08c46
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 81 deletions.
4 changes: 1 addition & 3 deletions tests/Browser/Outside/PhoneInputOutsideFromFilamentTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,7 @@ public function it_displays_phone_input_from_outside_the_filament()
$browser->visit('/world')
->waitForLivewireToLoad()
->pause(250)
->withIn('@phone-input.data.phone', function (Browser $browser) {
$browser->assertScript('document.querySelector(".iti__flag-container").nodeName', 'DIV');
});
->assertPresent('@phone-input.data.phone .iti__country-container');
});
}
}
2 changes: 1 addition & 1 deletion tests/Browser/PhoneInputGeoIpLookupTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public function it_should_be_render_with_ip_lookup()
fn (Browser $browser) => $browser
->waitUntil('window.phoneInputGeoIpLookup', 5)
->with('@phone-input.data.phone', function (Browser $browser) {
$browser->assertAttribute('.iti__selected-flag', 'title', 'Azerbaijan: +994');
$browser->assertAttribute('.iti__selected-country', 'title', 'Azerbaijan: +994');
})
->assertCookieValue('intlTelInputSelectedCountry', 'AZ', decrypt: false)
);
Expand Down
4 changes: 2 additions & 2 deletions tests/Browser/PhoneInputHidesFlagsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public function it_should_not_show_flags()
fn (Browser $browser) => $browser
->waitFor('@phone-input.data.phone')
->pause(500)
->assertMissing('.iti__flag-container')
->assertPresent('.iti__flag.iti__globe')
);
}
}
Expand All @@ -27,6 +27,6 @@ class PhoneInputHidesFlagResource extends FilamentPhoneInputUserResource
{
public static function getPhoneInput(): ?PhoneInput
{
return parent::getPhoneInput()->showFlags(false)->disallowDropdown();
return parent::getPhoneInput()->showFlags(false);
}
}
2 changes: 1 addition & 1 deletion tests/Browser/PhoneInputInitialCountryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public function it_should_be_render_with_initial_country()
->click('@phone-input.data.phone')
->pause(300)
->with('@phone-input.data.phone', function (Browser $browser) {
$browser->assertAttribute('.iti__selected-flag', 'title', 'Turkey: +90');
$browser->assertAttribute('.iti__selected-country', 'title', 'Turkey: +90');
})
);
}
Expand Down
4 changes: 2 additions & 2 deletions tests/Browser/PhoneInputOnlyCountriesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public function it_should_be_render_with_only_countries()
$this->phoneTest(
fn (Browser $browser) => $browser
->pause(300)
->click('@phone-input.data.phone .iti__selected-flag')
->click('@phone-input.data.phone .iti__selected-country')
->pause(700)
->with('@phone-input.data.phone .iti__country-list', function (Browser $browser) {
$browser->assertDataAttribute('.iti__country:nth-child(1)', 'country-code', 'az');
Expand All @@ -34,6 +34,6 @@ class PhoneInputOnlyCountriesResource extends FilamentPhoneInputUserResource
{
public static function getPhoneInput(): ?PhoneInput
{
return parent::getPhoneInput()->onlyCountries(['tr', 'gb', 'us', 'az', 'ru'])->preferredCountries([]);
return parent::getPhoneInput()->onlyCountries(['tr', 'gb', 'us', 'az', 'ru']);
}
}
37 changes: 0 additions & 37 deletions tests/Browser/PhoneInputPreferedCountriesTest.php

This file was deleted.

35 changes: 0 additions & 35 deletions tests/Browser/PhoneInputShowSelectedDialCodeTest.php

This file was deleted.

0 comments on commit bf08c46

Please sign in to comment.