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
5 changes: 5 additions & 0 deletions packages/manager/.changeset/pr-10888-tests-1725482771826.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@linode/manager": Tests
---

Update region selection helpers to account for upcoming Gecko improvements ([#10888](https://github.com/linode/manager/pull/10888))
10 changes: 7 additions & 3 deletions packages/manager/cypress/support/ui/autocomplete.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export const autocompletePopper = {
* Finds an item within an autocomplete popper that has the given title.
*/
findByTitle: (
title: string,
title: string | RegExp,
options?: SelectorMatcherOptions
): Cypress.Chainable => {
return (
Expand Down Expand Up @@ -90,7 +90,9 @@ export const regionSelect = {
*/
findItemByRegionId: (regionId: string, searchRegions?: Region[]) => {
const region = getRegionById(regionId, searchRegions);
return autocompletePopper.findByTitle(`${region.label} (${region.id})`);
return autocompletePopper.findByTitle(
new RegExp(`${region.label}\\s?(\(${region.id}\))?`)
);
},

/**
Expand All @@ -105,6 +107,8 @@ export const regionSelect = {
*/
findItemByRegionLabel: (regionLabel: string, searchRegions?: Region[]) => {
const region = getRegionByLabel(regionLabel, searchRegions);
return autocompletePopper.findByTitle(`${region.label} (${region.id})`);
return autocompletePopper.findByTitle(
new RegExp(`${region.label}\\s?(\(${region.id}\))?`)
);
},
};