-
Notifications
You must be signed in to change notification settings - Fork 165
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: adds find all selectors to test utils (#3024)
- Loading branch information
1 parent
2028cba
commit 035ae6b
Showing
11 changed files
with
5,349 additions
and
1,380 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,93 @@ | ||
// 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', | ||
FileDropzone: 'FileDropzones', | ||
FileInput: 'FileInputs', | ||
FileTokenGroup: 'FileTokenGroups', | ||
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 }; |
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.