-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add createSelector function * Prepare jest-selectors release 1.4.0 * Fix selectors types * Prepare jest-selectors release 1.4.1 * Update components to use createSelector * Update components changelog
- Loading branch information
Showing
13 changed files
with
126 additions
and
52 deletions.
There are no files selected for viewing
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
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
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 |
---|---|---|
@@ -1,23 +1,25 @@ | ||
import { createSelector } from '@volkovlabs/jest-selectors'; | ||
|
||
/** | ||
* Test Identifiers | ||
*/ | ||
export const TEST_IDS = { | ||
form: { | ||
root: (name: unknown) => `data-testid form-${name}`, | ||
sectionHeader: (name: unknown) => `data-testid form section-${name}`, | ||
sectionContent: (name: unknown) => `data-testid form section-content-${name}`, | ||
fieldSelect: (name: unknown) => `form field-select-${name}`, | ||
fieldCustom: (name: unknown) => `data-testid form field-custom-${name}`, | ||
fieldSlider: (name: unknown) => `data-testid form field-slider-${name}`, | ||
fieldRangeSlider: (name: unknown) => `form field-range-slider-${name}`, | ||
fieldNumberInput: (name: unknown) => `data-testid form field-number-input-${name}`, | ||
fieldColor: (name: unknown) => `data-testid form field-color-${name}`, | ||
fieldInput: (name: unknown) => `data-testid form field-input-${name}`, | ||
root: createSelector((name: unknown) => `data-testid form-${name}`), | ||
sectionHeader: createSelector((name: unknown) => `data-testid form section-${name}`, 'headerDataTestId'), | ||
sectionContent: createSelector((name: unknown) => `data-testid form section-content-${name}`, 'contentDataTestId'), | ||
fieldSelect: createSelector((name: unknown) => `form field-select-${name}`), | ||
fieldCustom: createSelector((name: unknown) => `data-testid form field-custom-${name}`), | ||
fieldSlider: createSelector((name: unknown) => `data-testid form field-slider-${name}`), | ||
fieldRangeSlider: createSelector((name: unknown) => `form field-range-slider-${name}`, 'sliderAriaLabel'), | ||
fieldNumberInput: createSelector((name: unknown) => `data-testid form field-number-input-${name}`), | ||
fieldColor: createSelector((name: unknown) => `data-testid form field-color-${name}`), | ||
fieldInput: createSelector((name: unknown) => `data-testid form field-input-${name}`), | ||
/** | ||
* We should use default value for date-time-picker without data-testid prefix | ||
* https://github.com/grafana/grafana/blob/f43762f39abad43f99b85cbcff6ca30c56f9d75f/packages/grafana-ui/src/components/DateTimePickers/DateTimePicker/DateTimePicker.tsx#L249 | ||
*/ | ||
fieldDatetime: () => `data-testid date-time-input`, | ||
fieldRadio: (name: unknown) => `data-testid form field-radio-${name}`, | ||
fieldDatetime: createSelector(() => `data-testid date-time-input`), | ||
fieldRadio: createSelector((name: unknown) => `data-testid form field-radio-${name}`), | ||
}, | ||
}; |
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
Oops, something went wrong.