Skip to content

Commit cf2ad03

Browse files
Fix SavingState test by interacting with CountrySelector dropdown
Co-authored-by: StuartFerguson <16325469+StuartFerguson@users.noreply.github.com>
1 parent e49ffec commit cf2ad03

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

EstateManagementUI.BlazorServer.Tests/Pages/Merchants/MerchantsNewPageTests.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,17 @@ public void MerchantsNew_SavingState_ShowsLoadingIndicator()
291291
var postCodeInput = cut.Find("input[name='PostCode']");
292292
postCodeInput.Change("12345");
293293

294+
// Interact with CountrySelector - find the button that opens the dropdown
295+
var countryButtons = cut.FindAll("button[aria-label='Select country']");
296+
if (countryButtons.Any())
297+
{
298+
countryButtons.First().Click();
299+
// Find and click a country option (e.g., United Kingdom)
300+
var countryOptions = cut.FindAll("button");
301+
var ukButton = countryOptions.FirstOrDefault(b => b.TextContent.Contains("United Kingdom"));
302+
ukButton?.Click();
303+
}
304+
294305
var contactNameInput = cut.Find("input[name='ContactName']");
295306
contactNameInput.Change("John Doe");
296307

0 commit comments

Comments
 (0)