@faststore/ui 1.12.4 → 1.12.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +18 -0
- package/dist/atoms/Badge/Badge.js +1 -1
- package/dist/atoms/Badge/Badge.js.map +1 -1
- package/dist/atoms/Button/Button.js +1 -1
- package/dist/atoms/Button/Button.js.map +1 -1
- package/dist/atoms/Checkbox/Checkbox.js +1 -1
- package/dist/atoms/Checkbox/Checkbox.js.map +1 -1
- package/dist/atoms/Icon/Icon.js +1 -1
- package/dist/atoms/Icon/Icon.js.map +1 -1
- package/dist/atoms/Incentive/Incentive.js +1 -1
- package/dist/atoms/Incentive/Incentive.js.map +1 -1
- package/dist/atoms/Input/Input.js +1 -1
- package/dist/atoms/Input/Input.js.map +1 -1
- package/dist/atoms/Label/Label.js +1 -1
- package/dist/atoms/Label/Label.js.map +1 -1
- package/dist/atoms/Link/Link.js +1 -1
- package/dist/atoms/Link/Link.js.map +1 -1
- package/dist/atoms/List/List.js +1 -1
- package/dist/atoms/List/List.js.map +1 -1
- package/dist/atoms/Overlay/Overlay.js +1 -1
- package/dist/atoms/Overlay/Overlay.js.map +1 -1
- package/dist/atoms/Popover/Popover.js +1 -1
- package/dist/atoms/Popover/Popover.js.map +1 -1
- package/dist/atoms/Price/Price.js +1 -1
- package/dist/atoms/Price/Price.js.map +1 -1
- package/dist/atoms/Radio/Radio.js +1 -1
- package/dist/atoms/Radio/Radio.js.map +1 -1
- package/dist/atoms/Select/Select.js +1 -1
- package/dist/atoms/Select/Select.js.map +1 -1
- package/dist/atoms/Skeleton/Skeleton.js +1 -1
- package/dist/atoms/Skeleton/Skeleton.js.map +1 -1
- package/dist/atoms/Slider/Slider.js +1 -1
- package/dist/atoms/Slider/Slider.js.map +1 -1
- package/dist/atoms/Spinner/Spinner.js +1 -1
- package/dist/atoms/Spinner/Spinner.js.map +1 -1
- package/dist/atoms/TextArea/TextArea.js +1 -1
- package/dist/atoms/TextArea/TextArea.js.map +1 -1
- package/dist/molecules/Accordion/Accordion.js +1 -1
- package/dist/molecules/Accordion/Accordion.js.map +1 -1
- package/dist/molecules/AggregateRating/AggregateRating.d.ts +1 -1
- package/dist/molecules/AggregateRating/AggregateRating.js +2 -2
- package/dist/molecules/AggregateRating/AggregateRating.js.map +1 -1
- package/dist/molecules/Alert/Alert.js +1 -1
- package/dist/molecules/Alert/Alert.js.map +1 -1
- package/dist/molecules/Banner/Banner.js +1 -1
- package/dist/molecules/Banner/Banner.js.map +1 -1
- package/dist/molecules/Breadcrumb/Breadcrumb.js +1 -1
- package/dist/molecules/Breadcrumb/Breadcrumb.js.map +1 -1
- package/dist/molecules/Bullets/Bullets.js +1 -1
- package/dist/molecules/Bullets/Bullets.js.map +1 -1
- package/dist/molecules/Card/Card.js +1 -1
- package/dist/molecules/Card/Card.js.map +1 -1
- package/dist/molecules/Carousel/Carousel.js +1 -1
- package/dist/molecules/Carousel/Carousel.js.map +1 -1
- package/dist/molecules/Dropdown/DropdownButton.js +1 -1
- package/dist/molecules/Dropdown/DropdownButton.js.map +1 -1
- package/dist/molecules/Dropdown/DropdownItem.js +1 -1
- package/dist/molecules/Dropdown/DropdownItem.js.map +1 -1
- package/dist/molecules/Dropdown/DropdownMenu.js +2 -2
- package/dist/molecules/Dropdown/DropdownMenu.js.map +1 -1
- package/dist/molecules/Form/Form.js +1 -1
- package/dist/molecules/Form/Form.js.map +1 -1
- package/dist/molecules/IconButton/IconButton.js +1 -1
- package/dist/molecules/IconButton/IconButton.js.map +1 -1
- package/dist/molecules/LoadingButton/LoadingButton.js +1 -1
- package/dist/molecules/LoadingButton/LoadingButton.js.map +1 -1
- package/dist/molecules/Modal/ModalContent.js +1 -1
- package/dist/molecules/Modal/ModalContent.js.map +1 -1
- package/dist/molecules/PaymentMethods/PaymentMethods.js +1 -1
- package/dist/molecules/PaymentMethods/PaymentMethods.js.map +1 -1
- package/dist/molecules/PriceRange/PriceRange.js +1 -1
- package/dist/molecules/PriceRange/PriceRange.js.map +1 -1
- package/dist/molecules/ProductCard/ProductCard.js +1 -1
- package/dist/molecules/ProductCard/ProductCard.js.map +1 -1
- package/dist/molecules/QuantitySelector/QuantitySelector.js +1 -1
- package/dist/molecules/QuantitySelector/QuantitySelector.js.map +1 -1
- package/dist/molecules/RadioGroup/RadioOption.js +2 -2
- package/dist/molecules/RadioGroup/RadioOption.js.map +1 -1
- package/dist/molecules/SearchInput/SearchInput.js +1 -1
- package/dist/molecules/SearchInput/SearchInput.js.map +1 -1
- package/dist/molecules/Table/Table.d.ts +1 -1
- package/dist/molecules/Table/Table.js +1 -1
- package/dist/molecules/Table/Table.js.map +1 -1
- package/dist/organisms/Hero/Hero.js +1 -1
- package/dist/organisms/Hero/Hero.js.map +1 -1
- package/dist/organisms/OutOfStock/OutOfStock.js +1 -1
- package/dist/organisms/OutOfStock/OutOfStock.js.map +1 -1
- package/package.json +3 -3
- package/src/atoms/Badge/Badge.test.tsx +2 -2
- package/src/atoms/Badge/Badge.tsx +1 -1
- package/src/atoms/Badge/stories/Badge.mdx +1 -1
- package/src/atoms/Button/Button.test.tsx +2 -2
- package/src/atoms/Button/Button.tsx +1 -1
- package/src/atoms/Button/stories/Button.mdx +1 -1
- package/src/atoms/Checkbox/Checkbox.test.tsx +2 -2
- package/src/atoms/Checkbox/Checkbox.tsx +1 -1
- package/src/atoms/Checkbox/stories/Checkbox.mdx +1 -1
- package/src/atoms/Icon/Icon.test.tsx +2 -2
- package/src/atoms/Icon/Icon.tsx +1 -1
- package/src/atoms/Icon/stories/Icon.mdx +1 -1
- package/src/atoms/Incentive/Incentive.test.tsx +2 -2
- package/src/atoms/Incentive/Incentive.tsx +1 -1
- package/src/atoms/Incentive/stories/Incentive.mdx +1 -1
- package/src/atoms/Input/Input.test.tsx +2 -2
- package/src/atoms/Input/Input.tsx +1 -1
- package/src/atoms/Input/stories/Input.mdx +1 -1
- package/src/atoms/Label/Label.test.tsx +2 -2
- package/src/atoms/Label/Label.tsx +1 -1
- package/src/atoms/Label/stories/Label.mdx +1 -1
- package/src/atoms/Link/Link.test.tsx +3 -3
- package/src/atoms/Link/Link.tsx +1 -1
- package/src/atoms/Link/stories/Link.mdx +1 -1
- package/src/atoms/List/List.test.tsx +5 -5
- package/src/atoms/List/List.tsx +1 -1
- package/src/atoms/List/stories/List.mdx +2 -2
- package/src/atoms/Overlay/Overlay.test.tsx +2 -2
- package/src/atoms/Overlay/Overlay.tsx +1 -1
- package/src/atoms/Overlay/stories/Overlay.mdx +1 -1
- package/src/atoms/Popover/Popover.test.tsx +2 -2
- package/src/atoms/Popover/Popover.tsx +1 -1
- package/src/atoms/Popover/stories/Popover.mdx +1 -1
- package/src/atoms/Price/Price.test.tsx +2 -2
- package/src/atoms/Price/Price.tsx +1 -1
- package/src/atoms/Price/stories/Price.mdx +1 -1
- package/src/atoms/Price/stories/Price.stories.tsx +1 -1
- package/src/atoms/Radio/Radio.test.tsx +2 -2
- package/src/atoms/Radio/Radio.tsx +1 -1
- package/src/atoms/Radio/stories/Radio.mdx +1 -1
- package/src/atoms/Select/Select.test.tsx +2 -2
- package/src/atoms/Select/Select.tsx +1 -1
- package/src/atoms/Select/stories/Select.mdx +1 -1
- package/src/atoms/Skeleton/Skeleton.test.tsx +2 -2
- package/src/atoms/Skeleton/Skeleton.tsx +1 -1
- package/src/atoms/Skeleton/stories/Skeleton.mdx +1 -1
- package/src/atoms/Slider/Slider.test.tsx +2 -2
- package/src/atoms/Slider/Slider.tsx +1 -1
- package/src/atoms/Slider/stories/Slider.mdx +1 -1
- package/src/atoms/Spinner/Spinner.test.tsx +2 -2
- package/src/atoms/Spinner/Spinner.tsx +1 -1
- package/src/atoms/Spinner/stories/Spinner.mdx +1 -1
- package/src/atoms/TextArea/TextArea.test.tsx +2 -2
- package/src/atoms/TextArea/TextArea.tsx +1 -1
- package/src/atoms/TextArea/stories/TextArea.mdx +1 -1
- package/src/molecules/Accordion/Accordion.test.tsx +2 -2
- package/src/molecules/Accordion/Accordion.tsx +1 -1
- package/src/molecules/Accordion/stories/Accordion.mdx +1 -1
- package/src/molecules/AggregateRating/AggregateRating.test.tsx +3 -3
- package/src/molecules/AggregateRating/AggregateRating.tsx +3 -3
- package/src/molecules/AggregateRating/stories/AggregateRating.mdx +1 -1
- package/src/molecules/AggregateRating/stories/AggregateRating.stories.tsx +1 -1
- package/src/molecules/Alert/Alert.test.tsx +2 -2
- package/src/molecules/Alert/Alert.tsx +1 -1
- package/src/molecules/Alert/stories/Alert.mdx +1 -1
- package/src/molecules/Banner/Banner.test.tsx +2 -2
- package/src/molecules/Banner/Banner.tsx +1 -1
- package/src/molecules/Banner/stories/Banner.mdx +2 -2
- package/src/molecules/Breadcrumb/Breadcrumb.test.tsx +2 -2
- package/src/molecules/Breadcrumb/Breadcrumb.tsx +1 -1
- package/src/molecules/Breadcrumb/stories/Breadcrumb.mdx +1 -1
- package/src/molecules/Bullets/Bullets.test.tsx +2 -2
- package/src/molecules/Bullets/Bullets.tsx +1 -1
- package/src/molecules/Bullets/stories/Bullets.mdx +1 -1
- package/src/molecules/Card/Card.test.tsx +2 -2
- package/src/molecules/Card/Card.tsx +1 -1
- package/src/molecules/Card/stories/Card.mdx +1 -1
- package/src/molecules/Carousel/Carousel.test.tsx +2 -2
- package/src/molecules/Carousel/Carousel.tsx +1 -1
- package/src/molecules/Carousel/stories/Carousel.mdx +2 -2
- package/src/molecules/Dropdown/DropdownButton.tsx +1 -1
- package/src/molecules/Dropdown/DropdownItem.tsx +1 -1
- package/src/molecules/Dropdown/DropdownMenu.tsx +2 -2
- package/src/molecules/Dropdown/stories/Dropdown.mdx +4 -4
- package/src/molecules/Form/Form.test.tsx +2 -2
- package/src/molecules/Form/Form.tsx +1 -1
- package/src/molecules/Form/stories/Form.mdx +1 -1
- package/src/molecules/IconButton/IconButton.test.tsx +2 -2
- package/src/molecules/IconButton/IconButton.tsx +1 -1
- package/src/molecules/IconButton/stories/IconButton.mdx +1 -1
- package/src/molecules/LoadingButton/LoadingButton.test.tsx +2 -2
- package/src/molecules/LoadingButton/LoadingButton.tsx +1 -1
- package/src/molecules/LoadingButton/stories/LoadingButton.mdx +1 -1
- package/src/molecules/Modal/Modal.test.tsx +2 -2
- package/src/molecules/Modal/ModalContent.tsx +1 -1
- package/src/molecules/Modal/stories/Modal.mdx +1 -1
- package/src/molecules/PaymentMethods/PaymentMethods.test.tsx +2 -2
- package/src/molecules/PaymentMethods/PaymentMethods.tsx +1 -1
- package/src/molecules/PaymentMethods/stories/PaymentMethods.mdx +1 -1
- package/src/molecules/PriceRange/PriceRange.test.tsx +2 -2
- package/src/molecules/PriceRange/PriceRange.tsx +1 -1
- package/src/molecules/PriceRange/stories/PriceRange.mdx +1 -1
- package/src/molecules/ProductCard/ProductCard.test.tsx +2 -2
- package/src/molecules/ProductCard/ProductCard.tsx +1 -1
- package/src/molecules/ProductCard/stories/ProductCard.mdx +1 -1
- package/src/molecules/QuantitySelector/QuantitySelector.tsx +1 -1
- package/src/molecules/QuantitySelector/stories/QuantitySelector.mdx +1 -1
- package/src/molecules/RadioGroup/RadioOption.tsx +2 -2
- package/src/molecules/RadioGroup/stories/RadioGroup.mdx +2 -2
- package/src/molecules/SearchInput/SearchInput.test.tsx +2 -2
- package/src/molecules/SearchInput/SearchInput.tsx +1 -1
- package/src/molecules/SearchInput/stories/SearchInput.mdx +1 -1
- package/src/molecules/Table/Table.test.tsx +1 -1
- package/src/molecules/Table/Table.tsx +1 -1
- package/src/molecules/Table/stories/Table.mdx +1 -1
- package/src/organisms/Hero/Hero.test.tsx +2 -2
- package/src/organisms/Hero/Hero.tsx +1 -1
- package/src/organisms/Hero/stories/Hero.mdx +1 -1
- package/src/organisms/OutOfStock/OutOfStock.test.tsx +1 -1
- package/src/organisms/OutOfStock/OutOfStock.tsx +1 -1
- package/src/organisms/OutOfStock/stories/OutOfStock.mdx +1 -1
|
@@ -7,7 +7,7 @@ import List from './List'
|
|
|
7
7
|
const optionsArray = ['Great', 'Ok', 'Bad']
|
|
8
8
|
|
|
9
9
|
describe('List', () => {
|
|
10
|
-
it('should have `data-
|
|
10
|
+
it('should have `data-fs-list` attribute', () => {
|
|
11
11
|
const { getByTestId } = render(
|
|
12
12
|
<List>
|
|
13
13
|
{optionsArray.map((value) => {
|
|
@@ -16,7 +16,7 @@ describe('List', () => {
|
|
|
16
16
|
</List>
|
|
17
17
|
)
|
|
18
18
|
|
|
19
|
-
expect(getByTestId('store-list')).toHaveAttribute('data-
|
|
19
|
+
expect(getByTestId('store-list')).toHaveAttribute('data-fs-list')
|
|
20
20
|
})
|
|
21
21
|
|
|
22
22
|
it('should be empty if no children are provided', () => {
|
|
@@ -35,7 +35,7 @@ describe('List', () => {
|
|
|
35
35
|
)
|
|
36
36
|
|
|
37
37
|
expect(getByTestId('store-list')).toHaveAttribute(
|
|
38
|
-
'data-
|
|
38
|
+
'data-fs-list',
|
|
39
39
|
'ordered'
|
|
40
40
|
)
|
|
41
41
|
|
|
@@ -48,7 +48,7 @@ describe('List', () => {
|
|
|
48
48
|
)
|
|
49
49
|
|
|
50
50
|
expect(getByTestId('store-list')).toHaveAttribute(
|
|
51
|
-
'data-
|
|
51
|
+
'data-fs-list',
|
|
52
52
|
'unordered'
|
|
53
53
|
)
|
|
54
54
|
|
|
@@ -61,7 +61,7 @@ describe('List', () => {
|
|
|
61
61
|
)
|
|
62
62
|
|
|
63
63
|
expect(getByTestId('store-list')).toHaveAttribute(
|
|
64
|
-
'data-
|
|
64
|
+
'data-fs-list',
|
|
65
65
|
'description'
|
|
66
66
|
)
|
|
67
67
|
})
|
package/src/atoms/List/List.tsx
CHANGED
|
@@ -27,7 +27,7 @@ const List = forwardRef<HTMLUListElement, ListProps>(function List(
|
|
|
27
27
|
) {
|
|
28
28
|
const dataAttributes = {
|
|
29
29
|
'data-testid': testId,
|
|
30
|
-
'data-
|
|
30
|
+
'data-fs-list': variant,
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
const Component = MaybeComponent ?? variantToElement[variant] ?? 'ul'
|
|
@@ -7,10 +7,10 @@ import Overlay from './Overlay'
|
|
|
7
7
|
describe('Overlay', () => {
|
|
8
8
|
const testId = 'store-overlay'
|
|
9
9
|
|
|
10
|
-
it('data-
|
|
10
|
+
it('data-fs-overlay is present', () => {
|
|
11
11
|
const { getByTestId } = render(<Overlay testId={testId} />)
|
|
12
12
|
|
|
13
|
-
expect(getByTestId(testId)).toHaveAttribute('data-
|
|
13
|
+
expect(getByTestId(testId)).toHaveAttribute('data-fs-overlay')
|
|
14
14
|
})
|
|
15
15
|
|
|
16
16
|
describe('Accessibility', () => {
|
|
@@ -21,10 +21,10 @@ const PopoverTemplate = (props: any) => {
|
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
describe('Popover', () => {
|
|
24
|
-
it('`data-
|
|
24
|
+
it('`data-fs-popover` is present', () => {
|
|
25
25
|
const { getByTestId } = render(<PopoverTemplate />)
|
|
26
26
|
|
|
27
|
-
expect(getByTestId('store-popover')).toHaveAttribute('data-
|
|
27
|
+
expect(getByTestId('store-popover')).toHaveAttribute('data-fs-popover')
|
|
28
28
|
})
|
|
29
29
|
|
|
30
30
|
describe('Accessibility', () => {
|
|
@@ -5,10 +5,10 @@ import React from 'react'
|
|
|
5
5
|
import Price from './Price'
|
|
6
6
|
|
|
7
7
|
describe('Price', () => {
|
|
8
|
-
it('`data-
|
|
8
|
+
it('`data-fs-price` is present', () => {
|
|
9
9
|
const { getByTestId } = render(<Price value={32.5} />)
|
|
10
10
|
|
|
11
|
-
expect(getByTestId('store-price')).toHaveAttribute('data-
|
|
11
|
+
expect(getByTestId('store-price')).toHaveAttribute('data-fs-price')
|
|
12
12
|
})
|
|
13
13
|
|
|
14
14
|
it('`data-variant` is equal to `selling` if no variant is defined', () => {
|
|
@@ -53,7 +53,7 @@ const INTLFormattedToPartsTemplate: Story<PriceProps> = ({
|
|
|
53
53
|
.formatToParts(price)
|
|
54
54
|
.map((part) => {
|
|
55
55
|
const props = {
|
|
56
|
-
[`data-
|
|
56
|
+
[`data-fs-price-${part.type}`]: true,
|
|
57
57
|
} as Record<string, unknown>
|
|
58
58
|
|
|
59
59
|
if (part.type === 'integer') {
|
|
@@ -5,10 +5,10 @@ import { axe } from 'jest-axe'
|
|
|
5
5
|
import Radio from './Radio'
|
|
6
6
|
|
|
7
7
|
describe('Radio', () => {
|
|
8
|
-
it('data-
|
|
8
|
+
it('data-fs-radio is present', () => {
|
|
9
9
|
const { getByTestId } = render(<Radio testId="store-radio" />)
|
|
10
10
|
|
|
11
|
-
expect(getByTestId('store-radio')).toHaveAttribute('data-
|
|
11
|
+
expect(getByTestId('store-radio')).toHaveAttribute('data-fs-radio')
|
|
12
12
|
})
|
|
13
13
|
|
|
14
14
|
it('type radio is present', () => {
|
|
@@ -19,7 +19,7 @@ const mapPairToOption = (value: string, label: string) => {
|
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
describe('Select', () => {
|
|
22
|
-
it('`data-
|
|
22
|
+
it('`data-fs-select` is present', () => {
|
|
23
23
|
const { getByTestId } = render(
|
|
24
24
|
<Select testId="store-select">
|
|
25
25
|
{optionsArray.map(([value, label]) => {
|
|
@@ -28,7 +28,7 @@ describe('Select', () => {
|
|
|
28
28
|
</Select>
|
|
29
29
|
)
|
|
30
30
|
|
|
31
|
-
expect(getByTestId('store-select')).toHaveAttribute('data-
|
|
31
|
+
expect(getByTestId('store-select')).toHaveAttribute('data-fs-select')
|
|
32
32
|
})
|
|
33
33
|
|
|
34
34
|
it('select is empty when no options are given', () => {
|
|
@@ -13,7 +13,7 @@ const Select = forwardRef<HTMLSelectElement, SelectProps>(function Select(
|
|
|
13
13
|
ref
|
|
14
14
|
) {
|
|
15
15
|
return (
|
|
16
|
-
<select ref={ref} data-
|
|
16
|
+
<select ref={ref} data-fs-select data-testid={testId} {...otherProps}>
|
|
17
17
|
{children}
|
|
18
18
|
</select>
|
|
19
19
|
)
|
|
@@ -4,10 +4,10 @@ import React from 'react'
|
|
|
4
4
|
import Skeleton from './Skeleton'
|
|
5
5
|
|
|
6
6
|
describe('Skeleton', () => {
|
|
7
|
-
it('`data-
|
|
7
|
+
it('`data-fs-skeleton` is present', () => {
|
|
8
8
|
const { getByTestId } = render(<Skeleton testId="store-skeleton" />)
|
|
9
9
|
const skeleton = getByTestId('store-skeleton')
|
|
10
10
|
|
|
11
|
-
expect(skeleton).toHaveAttribute('data-
|
|
11
|
+
expect(skeleton).toHaveAttribute('data-fs-skeleton')
|
|
12
12
|
})
|
|
13
13
|
})
|
|
@@ -13,7 +13,7 @@ const Skeleton = forwardRef<HTMLDivElement, SkeletonProps>(function Skeleton(
|
|
|
13
13
|
ref
|
|
14
14
|
) {
|
|
15
15
|
return (
|
|
16
|
-
<div ref={ref} data-
|
|
16
|
+
<div ref={ref} data-fs-skeleton data-testid={testId} {...otherProps} />
|
|
17
17
|
)
|
|
18
18
|
})
|
|
19
19
|
|
|
@@ -16,10 +16,10 @@ const props = {
|
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
describe('Slider', () => {
|
|
19
|
-
it('`data-
|
|
19
|
+
it('`data-fs-slider` is present', () => {
|
|
20
20
|
const { getByTestId } = render(<Slider {...props} />)
|
|
21
21
|
|
|
22
|
-
expect(getByTestId('store-slider')).toHaveAttribute('data-
|
|
22
|
+
expect(getByTestId('store-slider')).toHaveAttribute('data-fs-slider')
|
|
23
23
|
})
|
|
24
24
|
|
|
25
25
|
describe('Accessibility', () => {
|
|
@@ -120,7 +120,7 @@ const Slider = forwardRef<SliderRefType | undefined, SliderProps>(
|
|
|
120
120
|
}))
|
|
121
121
|
|
|
122
122
|
return (
|
|
123
|
-
<div data-
|
|
123
|
+
<div data-fs-slider data-testid={testId} className={className}>
|
|
124
124
|
<div
|
|
125
125
|
data-slider-range
|
|
126
126
|
style={{
|
|
@@ -4,9 +4,9 @@ import React from 'react'
|
|
|
4
4
|
import Spinner from './Spinner'
|
|
5
5
|
|
|
6
6
|
describe('Spinner', () => {
|
|
7
|
-
it('`data-
|
|
7
|
+
it('`data-fs-spinner` is present', () => {
|
|
8
8
|
const { getByTestId } = render(<Spinner />)
|
|
9
9
|
|
|
10
|
-
expect(getByTestId('store-spinner')).toHaveAttribute('data-
|
|
10
|
+
expect(getByTestId('store-spinner')).toHaveAttribute('data-fs-spinner')
|
|
11
11
|
})
|
|
12
12
|
})
|
|
@@ -11,7 +11,7 @@ export type SpinnerProps = {
|
|
|
11
11
|
const Spinner = forwardRef<HTMLDivElement, PropsWithChildren<SpinnerProps>>(
|
|
12
12
|
function Spinner({ children, testId = 'store-spinner', ...otherProps }, ref) {
|
|
13
13
|
return (
|
|
14
|
-
<span ref={ref} data-
|
|
14
|
+
<span ref={ref} data-fs-spinner data-testid={testId} {...otherProps} />
|
|
15
15
|
)
|
|
16
16
|
}
|
|
17
17
|
)
|
|
@@ -7,10 +7,10 @@ import TextArea from './TextArea'
|
|
|
7
7
|
const testId = 'store-textarea'
|
|
8
8
|
|
|
9
9
|
describe('TextArea', () => {
|
|
10
|
-
it('data-
|
|
10
|
+
it('data-fs-textarea is present', () => {
|
|
11
11
|
const { getByTestId } = render(<TextArea testId={testId} />)
|
|
12
12
|
|
|
13
|
-
expect(getByTestId(testId)).toHaveAttribute('data-
|
|
13
|
+
expect(getByTestId(testId)).toHaveAttribute('data-fs-textarea')
|
|
14
14
|
})
|
|
15
15
|
|
|
16
16
|
it('state is error', () => {
|
|
@@ -127,8 +127,8 @@ describe('Accordion', () => {
|
|
|
127
127
|
})
|
|
128
128
|
|
|
129
129
|
describe('Data attributes', () => {
|
|
130
|
-
it('`Accordion` component should have `data-
|
|
131
|
-
expect(accordion).toHaveAttribute('data-
|
|
130
|
+
it('`Accordion` component should have `data-fs-accordion` attribute', () => {
|
|
131
|
+
expect(accordion).toHaveAttribute('data-fs-accordion')
|
|
132
132
|
})
|
|
133
133
|
|
|
134
134
|
it('`AccordionItem` component should have `data-accordion-item` attribute', () => {
|
|
@@ -17,7 +17,7 @@ const fillCheck = (value: number) => {
|
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
describe('AggregateRating', () => {
|
|
20
|
-
it('`data-
|
|
20
|
+
it('`data-fs-aggregate-rating` is present', () => {
|
|
21
21
|
const { getByTestId } = render(
|
|
22
22
|
<AggregateRating value={2}>
|
|
23
23
|
<span />
|
|
@@ -29,7 +29,7 @@ describe('AggregateRating', () => {
|
|
|
29
29
|
)
|
|
30
30
|
|
|
31
31
|
expect(getByTestId('store-aggregate-rating')).toHaveAttribute(
|
|
32
|
-
'data-
|
|
32
|
+
'data-fs-aggregate-rating'
|
|
33
33
|
)
|
|
34
34
|
})
|
|
35
35
|
|
|
@@ -64,7 +64,7 @@ describe('AggregateRating', () => {
|
|
|
64
64
|
currentItemNumber += 1
|
|
65
65
|
) {
|
|
66
66
|
expect(ratingItems[currentItemNumber]).toHaveAttribute(
|
|
67
|
-
'data-
|
|
67
|
+
'data-fs-aggregate-rating-item',
|
|
68
68
|
fillCheck(value - currentItemNumber)
|
|
69
69
|
)
|
|
70
70
|
}
|
|
@@ -16,7 +16,7 @@ export interface AggregateRatingProps extends ListProps<HTMLUListElement> {
|
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
export interface RatingItemProps {
|
|
19
|
-
'data-
|
|
19
|
+
'data-fs-aggregate-rating-item'?: 'full' | 'partial' | 'empty'
|
|
20
20
|
'data-testid'?: string
|
|
21
21
|
}
|
|
22
22
|
|
|
@@ -56,7 +56,7 @@ const AggregateRating = forwardRef<HTMLUListElement, AggregateRatingProps>(
|
|
|
56
56
|
|
|
57
57
|
return (
|
|
58
58
|
<List
|
|
59
|
-
data-
|
|
59
|
+
data-fs-aggregate-rating
|
|
60
60
|
variant={variant}
|
|
61
61
|
ref={ref}
|
|
62
62
|
data-testid={testId}
|
|
@@ -69,7 +69,7 @@ const AggregateRating = forwardRef<HTMLUListElement, AggregateRatingProps>(
|
|
|
69
69
|
return (
|
|
70
70
|
<RatingItem
|
|
71
71
|
key={`aggregate-rating-${index}`}
|
|
72
|
-
data-
|
|
72
|
+
data-fs-aggregate-rating-item={fill}
|
|
73
73
|
data-testid={`${testId}-item`}
|
|
74
74
|
>
|
|
75
75
|
{child}
|
|
@@ -31,7 +31,7 @@ const RatingIcon: FC<RatingItemProps> = (props) => {
|
|
|
31
31
|
d="M20.388,10.918L32,12.118l-8.735,7.749L25.914,
|
|
32
32
|
31.4l-9.893-6.088L6.127,31.4l2.695-11.533L0,
|
|
33
33
|
12.118l11.547-1.2L16.026,0.6L20.388,10.918z"
|
|
34
|
-
fill={fillColor[props['data-
|
|
34
|
+
fill={fillColor[props['data-fs-aggregate-rating-item']!]}
|
|
35
35
|
strokeWidth="2"
|
|
36
36
|
stroke="#ffb100"
|
|
37
37
|
/>
|
|
@@ -6,10 +6,10 @@ import Alert from './Alert'
|
|
|
6
6
|
|
|
7
7
|
describe('Alert', () => {
|
|
8
8
|
describe('Data attributes', () => {
|
|
9
|
-
it('should have `data-
|
|
9
|
+
it('should have `data-fs-alert` attribute', () => {
|
|
10
10
|
const { getByTestId } = render(<Alert>Testing</Alert>)
|
|
11
11
|
|
|
12
|
-
expect(getByTestId('store-alert')).toHaveAttribute('data-
|
|
12
|
+
expect(getByTestId('store-alert')).toHaveAttribute('data-fs-alert')
|
|
13
13
|
})
|
|
14
14
|
})
|
|
15
15
|
|
|
@@ -36,8 +36,8 @@ describe('Banner', () => {
|
|
|
36
36
|
const bannerContent = getByTestId('store-banner-content')
|
|
37
37
|
const bannerLink = getByTestId('store-banner-link')
|
|
38
38
|
|
|
39
|
-
it('`Banner` component should have `data-
|
|
40
|
-
expect(banner).toHaveAttribute('data-
|
|
39
|
+
it('`Banner` component should have `data-fs-banner` attribute', () => {
|
|
40
|
+
expect(banner).toHaveAttribute('data-fs-banner')
|
|
41
41
|
})
|
|
42
42
|
|
|
43
43
|
it('`Banner` component should have custom data attribute `data-custom-attribute`', () => {
|
|
@@ -50,9 +50,9 @@ Besides those attributes, the following props are also supported:
|
|
|
50
50
|
## CSS Selectors
|
|
51
51
|
|
|
52
52
|
```css
|
|
53
|
-
[data-
|
|
53
|
+
[data-fs-banner] {
|
|
54
54
|
}
|
|
55
|
-
[data-
|
|
55
|
+
[data-fs-banner='(vertical|horizontal)'] {
|
|
56
56
|
}
|
|
57
57
|
[data-banner-image] {
|
|
58
58
|
}
|
|
@@ -5,11 +5,11 @@ import React from 'react'
|
|
|
5
5
|
import Breadcrumb from './Breadcrumb'
|
|
6
6
|
|
|
7
7
|
describe('Breadcrumb', () => {
|
|
8
|
-
it('`data-
|
|
8
|
+
it('`data-fs-breadcrumb` is present', () => {
|
|
9
9
|
const { getByTestId } = render(<Breadcrumb />)
|
|
10
10
|
|
|
11
11
|
expect(getByTestId('store-breadcrumb')).toHaveAttribute(
|
|
12
|
-
'data-
|
|
12
|
+
'data-fs-breadcrumb'
|
|
13
13
|
)
|
|
14
14
|
})
|
|
15
15
|
|
|
@@ -5,12 +5,12 @@ import React from 'react'
|
|
|
5
5
|
import Bullets from './Bullets'
|
|
6
6
|
|
|
7
7
|
describe('Bullets', () => {
|
|
8
|
-
it('should have `data-
|
|
8
|
+
it('should have `data-fs-bullets` attribute', () => {
|
|
9
9
|
const { getByTestId } = render(
|
|
10
10
|
<Bullets totalQuantity={5} activeBullet={2} onClick={() => null} />
|
|
11
11
|
)
|
|
12
12
|
|
|
13
|
-
expect(getByTestId('store-bullets')).toHaveAttribute('data-
|
|
13
|
+
expect(getByTestId('store-bullets')).toHaveAttribute('data-fs-bullets')
|
|
14
14
|
})
|
|
15
15
|
|
|
16
16
|
it('should render 5 bullets with `data-bullet-item` attribute', () => {
|
|
@@ -43,8 +43,8 @@ describe('Card', () => {
|
|
|
43
43
|
})
|
|
44
44
|
|
|
45
45
|
describe('Data attributes', () => {
|
|
46
|
-
it('`Card` component should have `data-
|
|
47
|
-
expect(card).toHaveAttribute('data-
|
|
46
|
+
it('`Card` component should have `data-fs-card` attribute', () => {
|
|
47
|
+
expect(card).toHaveAttribute('data-fs-card')
|
|
48
48
|
})
|
|
49
49
|
|
|
50
50
|
it('`CardContent` component should have `data-card-content` attribute', () => {
|