-
Notifications
You must be signed in to change notification settings - Fork 158
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Adds findXAll and findXByTestId selectors
- Loading branch information
1 parent
77a8d98
commit 44ecbba
Showing
6 changed files
with
6,044 additions
and
793 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
const pluralizationMap = { | ||
Alert: 'Alerts', | ||
AnchorNavigation: 'AnchorNavigations', | ||
Annotation: 'Annotations', | ||
AppLayout: 'AppLayouts', | ||
AreaChart: 'AreaCharts', | ||
AttributeEditor: 'AttributeEditors', | ||
Autosuggest: 'Autosuggests', | ||
Badge: 'Badges', | ||
BarChart: 'BarCharts', | ||
Box: 'Boxes', | ||
BreadcrumbGroup: 'BreadcrumbGroups', | ||
Button: 'Buttons', | ||
ButtonDropdown: 'ButtonDropdowns', | ||
ButtonGroup: 'ButtonGroups', | ||
Calendar: 'Calendars', | ||
Cards: 'Cards', | ||
Checkbox: 'Checkboxes', | ||
CodeEditor: 'CodeEditors', | ||
CollectionPreferences: 'CollectionPreferences', | ||
ColumnLayout: 'ColumnLayouts', | ||
Container: 'Containers', | ||
ContentLayout: 'ContentLayouts', | ||
CopyToClipboard: 'CopyToClipboards', | ||
DateInput: 'DateInputs', | ||
DatePicker: 'DatePickers', | ||
DateRangePicker: 'DateRangePickers', | ||
Drawer: 'Drawers', | ||
ExpandableSection: 'ExpandableSections', | ||
FileUpload: 'FileUploads', | ||
Flashbar: 'Flashbars', | ||
Form: 'Forms', | ||
FormField: 'FormFields', | ||
Grid: 'Grids', | ||
Header: 'Headers', | ||
HelpPanel: 'HelpPanels', | ||
Hotspot: 'Hotspots', | ||
Icon: 'Icons', | ||
Input: 'Inputs', | ||
KeyValuePairs: 'KeyValuePairs', | ||
LineChart: 'LineCharts', | ||
Link: 'Links', | ||
LiveRegion: 'LiveRegions', | ||
MixedLineBarChart: 'MixedLineBarCharts', | ||
Modal: 'Modals', | ||
Multiselect: 'Multiselects', | ||
Pagination: 'Paginations', | ||
PieChart: 'PieCharts', | ||
Popover: 'Popovers', | ||
ProgressBar: 'ProgressBars', | ||
PromptInput: 'PromptInputs', | ||
PropertyFilter: 'PropertyFilters', | ||
RadioGroup: 'RadioGroups', | ||
S3ResourceSelector: 'S3ResourceSelectors', | ||
SegmentedControl: 'SegmentedControls', | ||
Select: 'Selects', | ||
SideNavigation: 'SideNavigations', | ||
Slider: 'Sliders', | ||
SpaceBetween: 'SpaceBetweens', | ||
Spinner: 'Spinners', | ||
SplitPanel: 'SplitPanels', | ||
StatusIndicator: 'StatusIndicators', | ||
Steps: 'Steps', | ||
Table: 'Tables', | ||
Tabs: 'Tabs', | ||
TagEditor: 'TagEditors', | ||
TextContent: 'TextContents', | ||
TextFilter: 'TextFilters', | ||
Textarea: 'Textareas', | ||
Tiles: 'Tiles', | ||
TimeInput: 'TimeInputs', | ||
Toggle: 'Toggles', | ||
ToggleButton: 'ToggleButtons', | ||
TokenGroup: 'TokenGroups', | ||
TopNavigation: 'TopNavigations', | ||
TutorialPanel: 'TutorialPanels', | ||
Wizard: 'Wizards', | ||
}; | ||
|
||
function pluralizeComponentName(componentName) { | ||
if (!(componentName in pluralizationMap)) { | ||
throw new Error(`Could not find the plural case for ${componentName}.`); | ||
} | ||
|
||
return pluralizationMap[componentName]; | ||
} | ||
|
||
module.exports = { pluralizeComponentName }; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Oops, something went wrong.