-
Notifications
You must be signed in to change notification settings - Fork 825
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: select us-east-2 in integ tests (#3992)
- Loading branch information
1 parent
74281cc
commit ed48cf5
Showing
7 changed files
with
55 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { ExecutionContext } from 'amplify-e2e-core'; | ||
|
||
export const moveDown = (chain: ExecutionContext, nMoves: number) => | ||
Array.from(Array(nMoves).keys()).reduce((chain, _idx) => chain.send('j'), chain); | ||
|
||
export const moveUp = (chain: ExecutionContext, nMoves: number) => | ||
Array.from(Array(nMoves).keys()).reduce((chain, _idx) => chain.send('k'), chain); | ||
|
||
export const singleSelect = <T>(chain: ExecutionContext, item: T, allChoices: T[]) => multiSelect(chain, [item], allChoices); | ||
|
||
export const multiSelect = <T>(chain: ExecutionContext, items: T[], allChoices: T[]) => | ||
items | ||
.map(item => allChoices.indexOf(item)) | ||
.filter(idx => idx > -1) | ||
.sort() | ||
// calculate the diff with the latest, since items are sorted, always positive | ||
// represents the numbers of moves down we need to make to selection | ||
.reduce((diffs, move) => (diffs.length > 0 ? [...diffs, move - diffs[diffs.length - 1]] : [move]), [] as number[]) | ||
.reduce((chain, move) => moveDown(chain, move).send(' '), chain) | ||
.sendCarriageReturn(); |
3 changes: 3 additions & 0 deletions
3
packages/amplify-provider-awscloudformation/lib/aws-regions.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters