@channel.io/bezier-react 3.1.3 → 3.1.4

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.
Files changed (130) hide show
  1. package/dist/cjs/components/AlphaAvatar/Avatar.js +0 -2
  2. package/dist/cjs/components/AlphaAvatar/Avatar.js.map +1 -1
  3. package/dist/cjs/components/Avatar/Avatar.js +0 -2
  4. package/dist/cjs/components/Avatar/Avatar.js.map +1 -1
  5. package/dist/cjs/components/Badge/Badge.js +0 -1
  6. package/dist/cjs/components/Badge/Badge.js.map +1 -1
  7. package/dist/cjs/components/Checkbox/Checkbox.js +2 -0
  8. package/dist/cjs/components/Checkbox/Checkbox.js.map +1 -1
  9. package/dist/cjs/components/Divider/Divider.js +1 -1
  10. package/dist/cjs/components/Divider/Divider.js.map +1 -1
  11. package/dist/cjs/components/Emoji/Emoji.js +0 -1
  12. package/dist/cjs/components/Emoji/Emoji.js.map +1 -1
  13. package/dist/cjs/components/FormControl/FormControl.js +0 -1
  14. package/dist/cjs/components/FormControl/FormControl.js.map +1 -1
  15. package/dist/cjs/components/FormHelperText/FormHelperText.js +4 -2
  16. package/dist/cjs/components/FormHelperText/FormHelperText.js.map +1 -1
  17. package/dist/cjs/components/NavGroup/NavGroup.js +4 -2
  18. package/dist/cjs/components/NavGroup/NavGroup.js.map +1 -1
  19. package/dist/cjs/components/NavItem/NavItem.js +4 -2
  20. package/dist/cjs/components/NavItem/NavItem.js.map +1 -1
  21. package/dist/cjs/components/Switch/Switch.js +0 -1
  22. package/dist/cjs/components/Switch/Switch.js.map +1 -1
  23. package/dist/cjs/components/Tag/Tag.js +5 -2
  24. package/dist/cjs/components/Tag/Tag.js.map +1 -1
  25. package/dist/cjs/components/TextField/TextField.js +5 -2
  26. package/dist/cjs/components/TextField/TextField.js.map +1 -1
  27. package/dist/esm/components/AlphaAvatar/Avatar.mjs +1 -1
  28. package/dist/esm/components/AlphaAvatar/Avatar.mjs.map +1 -1
  29. package/dist/esm/components/Avatar/Avatar.mjs +1 -1
  30. package/dist/esm/components/Avatar/Avatar.mjs.map +1 -1
  31. package/dist/esm/components/Badge/Badge.mjs +1 -1
  32. package/dist/esm/components/Badge/Badge.mjs.map +1 -1
  33. package/dist/esm/components/Checkbox/Checkbox.mjs +2 -0
  34. package/dist/esm/components/Checkbox/Checkbox.mjs.map +1 -1
  35. package/dist/esm/components/Divider/Divider.mjs +2 -1
  36. package/dist/esm/components/Divider/Divider.mjs.map +1 -1
  37. package/dist/esm/components/Emoji/Emoji.mjs +1 -1
  38. package/dist/esm/components/Emoji/Emoji.mjs.map +1 -1
  39. package/dist/esm/components/FormControl/FormControl.mjs +1 -1
  40. package/dist/esm/components/FormControl/FormControl.mjs.map +1 -1
  41. package/dist/esm/components/FormHelperText/FormHelperText.mjs +5 -1
  42. package/dist/esm/components/FormHelperText/FormHelperText.mjs.map +1 -1
  43. package/dist/esm/components/NavGroup/NavGroup.mjs +5 -1
  44. package/dist/esm/components/NavGroup/NavGroup.mjs.map +1 -1
  45. package/dist/esm/components/NavItem/NavItem.mjs +5 -1
  46. package/dist/esm/components/NavItem/NavItem.mjs.map +1 -1
  47. package/dist/esm/components/Switch/Switch.mjs +1 -1
  48. package/dist/esm/components/Switch/Switch.mjs.map +1 -1
  49. package/dist/esm/components/Tag/Tag.mjs +6 -1
  50. package/dist/esm/components/Tag/Tag.mjs.map +1 -1
  51. package/dist/esm/components/TextField/TextField.mjs +6 -1
  52. package/dist/esm/components/TextField/TextField.mjs.map +1 -1
  53. package/dist/types/components/AlphaAvatar/Avatar.d.ts +0 -2
  54. package/dist/types/components/AlphaAvatar/Avatar.d.ts.map +1 -1
  55. package/dist/types/components/Avatar/Avatar.d.ts +0 -2
  56. package/dist/types/components/Avatar/Avatar.d.ts.map +1 -1
  57. package/dist/types/components/Badge/Badge.d.ts +0 -1
  58. package/dist/types/components/Badge/Badge.d.ts.map +1 -1
  59. package/dist/types/components/Checkbox/Checkbox.d.ts +2 -1
  60. package/dist/types/components/Checkbox/Checkbox.d.ts.map +1 -1
  61. package/dist/types/components/Divider/Divider.d.ts +0 -1
  62. package/dist/types/components/Divider/Divider.d.ts.map +1 -1
  63. package/dist/types/components/Emoji/Emoji.d.ts +0 -1
  64. package/dist/types/components/Emoji/Emoji.d.ts.map +1 -1
  65. package/dist/types/components/FormControl/FormControl.d.ts +0 -1
  66. package/dist/types/components/FormControl/FormControl.d.ts.map +1 -1
  67. package/dist/types/components/FormHelperText/FormHelperText.d.ts +0 -2
  68. package/dist/types/components/FormHelperText/FormHelperText.d.ts.map +1 -1
  69. package/dist/types/components/NavGroup/NavGroup.d.ts +0 -2
  70. package/dist/types/components/NavGroup/NavGroup.d.ts.map +1 -1
  71. package/dist/types/components/NavItem/NavItem.d.ts +0 -2
  72. package/dist/types/components/NavItem/NavItem.d.ts.map +1 -1
  73. package/dist/types/components/Switch/Switch.d.ts +0 -1
  74. package/dist/types/components/Switch/Switch.d.ts.map +1 -1
  75. package/dist/types/components/Tag/Tag.d.ts +0 -2
  76. package/dist/types/components/Tag/Tag.d.ts.map +1 -1
  77. package/dist/types/components/TextField/TextField.d.ts +0 -2
  78. package/dist/types/components/TextField/TextField.d.ts.map +1 -1
  79. package/package.json +2 -3
  80. package/src/components/AlphaAvatar/Avatar.test.tsx +1 -71
  81. package/src/components/AlphaAvatar/Avatar.tsx +2 -2
  82. package/src/components/AlphaAvatarGroup/AvatarGroup.test.tsx +0 -12
  83. package/src/components/Avatar/Avatar.test.tsx +1 -71
  84. package/src/components/Avatar/Avatar.tsx +2 -2
  85. package/src/components/AvatarGroup/AvatarGroup.test.tsx +0 -12
  86. package/src/components/Badge/Badge.tsx +2 -2
  87. package/src/components/Checkbox/Checkbox.tsx +6 -1
  88. package/src/components/Divider/Divider.test.tsx +11 -12
  89. package/src/components/Divider/Divider.tsx +5 -1
  90. package/src/components/Emoji/Emoji.tsx +4 -1
  91. package/src/components/FormControl/FormControl.test.tsx +1 -39
  92. package/src/components/FormControl/FormControl.tsx +1 -1
  93. package/src/components/FormHelperText/FormHelperText.test.tsx +11 -30
  94. package/src/components/FormHelperText/FormHelperText.tsx +9 -2
  95. package/src/components/FormLabel/FormLabel.test.tsx +0 -7
  96. package/src/components/Help/Help.test.tsx +0 -14
  97. package/src/components/LegacyTooltip/LegacyTooltip.test.tsx +0 -12
  98. package/src/components/Modal/Modal.test.tsx +8 -1
  99. package/src/components/NavGroup/NavGroup.tsx +9 -2
  100. package/src/components/NavItem/NavItem.tsx +9 -2
  101. package/src/components/Slider/Slider.test.tsx +1 -8
  102. package/src/components/SmoothCornersBox/SmoothCornersBox.test.tsx +0 -5
  103. package/src/components/Switch/Switch.test.tsx +17 -17
  104. package/src/components/Switch/Switch.tsx +4 -1
  105. package/src/components/Tag/Tag.test.tsx +11 -15
  106. package/src/components/Tag/Tag.tsx +10 -2
  107. package/src/components/TextField/TextField.test.tsx +5 -5
  108. package/src/components/TextField/TextField.tsx +10 -2
  109. package/src/components/AlphaAvatar/__snapshots__/Avatar.test.tsx.snap +0 -93
  110. package/src/components/AlphaAvatarGroup/__snapshots__/AvatarGroup.test.tsx.snap +0 -215
  111. package/src/components/Avatar/__snapshots__/Avatar.test.tsx.snap +0 -93
  112. package/src/components/AvatarGroup/__snapshots__/AvatarGroup.test.tsx.snap +0 -215
  113. package/src/components/Badge/Badge.test.tsx +0 -27
  114. package/src/components/Badge/__snapshots__/Badge.test.tsx.snap +0 -8
  115. package/src/components/Emoji/Emoji.test.tsx +0 -32
  116. package/src/components/Emoji/__snapshots__/Emoji.test.tsx.snap +0 -11
  117. package/src/components/FormControl/__snapshots__/FormControl.test.tsx.snap +0 -249
  118. package/src/components/FormGroup/FormGroup.test.tsx +0 -24
  119. package/src/components/FormGroup/__snapshots__/FormGroup.test.tsx.snap +0 -10
  120. package/src/components/FormHelperText/__snapshots__/FormHelperText.test.tsx.snap +0 -24
  121. package/src/components/FormLabel/__snapshots__/FormLabel.test.tsx.snap +0 -11
  122. package/src/components/Help/__snapshots__/Help.test.tsx.snap +0 -21
  123. package/src/components/LegacyTooltip/__snapshots__/LegacyTooltip.test.tsx.snap +0 -37
  124. package/src/components/NavGroup/NavGroup.test.tsx +0 -75
  125. package/src/components/NavGroup/__snapshots__/NavGroup.test.tsx.snap +0 -121
  126. package/src/components/NavItem/NavItem.test.tsx +0 -66
  127. package/src/components/NavItem/__snapshots__/NavItem.test.tsx.snap +0 -75
  128. package/src/components/Slider/__snapshots__/Slider.test.tsx.snap +0 -50
  129. package/src/components/SmoothCornersBox/__snapshots__/SmoothCornersBox.test.tsx.snap +0 -11
  130. package/src/components/Tag/__snapshots__/Tag.test.tsx.snap +0 -8
@@ -1,11 +1,6 @@
1
1
  import { render } from '~/src/utils/test'
2
2
 
3
- import {
4
- AVATAR_TEST_ID,
5
- AVATAR_WRAPPER_TEST_ID,
6
- Avatar,
7
- STATUS_WRAPPER_TEST_ID,
8
- } from './Avatar'
3
+ import { AVATAR_WRAPPER_TEST_ID, Avatar } from './Avatar'
9
4
  import type { AvatarProps } from './Avatar.types'
10
5
 
11
6
  describe('Avatar >', () => {
@@ -35,75 +30,10 @@ describe('Avatar >', () => {
35
30
  />
36
31
  )
37
32
 
38
- it('Snapshot', () => {
39
- const { getByTestId } = renderAvatar()
40
- const img = getByTestId(AVATAR_TEST_ID)
41
-
42
- expect(img).toMatchSnapshot()
43
- })
44
-
45
33
  it('renders disabled style', () => {
46
34
  const { getByTestId } = renderAvatar({ disabled: true })
47
35
  const wrapper = getByTestId(AVATAR_WRAPPER_TEST_ID)
48
36
 
49
37
  expect(wrapper).toHaveStyle('opacity: var(--opacity-disabled)')
50
38
  })
51
-
52
- it('renders border style', () => {
53
- const { getByTestId } = renderAvatar({ showBorder: true })
54
- const img = getByTestId(AVATAR_TEST_ID)
55
-
56
- // NOTE(@ed): psuedo element 스타일 테스트가 어려워, 스냅샷 테스트로 대체
57
- expect(img).toMatchSnapshot()
58
- })
59
-
60
- it('should have right -2px, bottom -2px style on StatusWrapper', () => {
61
- const { getByTestId } = renderAvatar({ status: 'online' })
62
- const statusWrapper = getByTestId(STATUS_WRAPPER_TEST_ID)
63
-
64
- expect(statusWrapper).toMatchSnapshot()
65
- })
66
-
67
- it('should have right 2px, bottom 2px style on StatusWrapper when show border', () => {
68
- const { getByTestId } = renderAvatar({ status: 'online', showBorder: true })
69
- const statusWrapper = getByTestId(STATUS_WRAPPER_TEST_ID)
70
-
71
- expect(statusWrapper).toMatchSnapshot()
72
- })
73
-
74
- it('should have right 4px, bottom 4px style on StatusWrapper when size grater then 72', () => {
75
- const { getByTestId } = renderAvatar({ status: 'online', size: '72' })
76
- const statusWrapper = getByTestId(STATUS_WRAPPER_TEST_ID)
77
-
78
- expect(statusWrapper).toMatchSnapshot()
79
- })
80
-
81
- it('should have right 8px, bottom 8px style on StatusWrapper when size grater then 72 and show border', () => {
82
- const { getByTestId } = renderAvatar({
83
- status: 'online',
84
- size: '72',
85
- showBorder: true,
86
- })
87
- const statusWrapper = getByTestId(STATUS_WRAPPER_TEST_ID)
88
-
89
- expect(statusWrapper).toMatchSnapshot()
90
- })
91
-
92
- it('should have right 4px, bottom 4px style on StatusWrapper when size grater then 90', () => {
93
- const { getByTestId } = renderAvatar({ status: 'online', size: '90' })
94
- const statusWrapper = getByTestId(STATUS_WRAPPER_TEST_ID)
95
-
96
- expect(statusWrapper).toMatchSnapshot()
97
- })
98
-
99
- it('should have right 8px, bottom 8px style on StatusWrapper when size grater then 90 and show border', () => {
100
- const { getByTestId } = renderAvatar({
101
- status: 'online',
102
- size: '90',
103
- showBorder: true,
104
- })
105
- const statusWrapper = getByTestId(STATUS_WRAPPER_TEST_ID)
106
-
107
- expect(statusWrapper).toMatchSnapshot()
108
- })
109
39
  })
@@ -29,8 +29,8 @@ export function useAvatarRadiusToken() {
29
29
  }
30
30
 
31
31
  export const AVATAR_WRAPPER_TEST_ID = 'bezier-avatar-wrapper'
32
- export const AVATAR_TEST_ID = 'bezier-avatar'
33
- export const STATUS_WRAPPER_TEST_ID = 'bezier-status-wrapper'
32
+ const AVATAR_TEST_ID = 'bezier-avatar'
33
+ const STATUS_WRAPPER_TEST_ID = 'bezier-status-wrapper'
34
34
 
35
35
  /**
36
36
  * `Avatar` is a component for representing some profile image.
@@ -44,12 +44,6 @@ describe('AvatarGroup', () => {
44
44
  props.ellipsisType = 'icon'
45
45
  })
46
46
 
47
- it('Snapshot', () => {
48
- const { getByRole } = renderComponent()
49
- const rendered = getByRole('group')
50
- expect(rendered).toMatchSnapshot()
51
- })
52
-
53
47
  it('should render ellipsis icon when avatar count is more than max', () => {
54
48
  const { getByTestId } = renderComponent()
55
49
  const rendered = getByTestId(AVATAR_GROUP_ELLIPSIS_ICON_TEST_ID)
@@ -69,12 +63,6 @@ describe('AvatarGroup', () => {
69
63
  props.ellipsisType = 'count'
70
64
  })
71
65
 
72
- it('Snapshot', () => {
73
- const { getByRole } = renderComponent()
74
- const rendered = getByRole('group')
75
- expect(rendered).toMatchSnapshot()
76
- })
77
-
78
66
  it('should render ellipsis count when avatar count is more than max', () => {
79
67
  const { getByText } = renderComponent()
80
68
  const rendered = getByText('+1')
@@ -9,7 +9,7 @@ import { Icon } from '~/src/components/Icon'
9
9
 
10
10
  import { type BadgeProps } from './Badge.types'
11
11
 
12
- export const BADGE_TEST_ID = 'bezier-badge'
12
+ const BADGE_TEST_ID = 'bezier-badge'
13
13
 
14
14
  /**
15
15
  * `Badge` is a component for representing badge, which consists of text and icon.
@@ -26,7 +26,7 @@ export const BADGE_TEST_ID = 'bezier-badge'
26
26
  */
27
27
  export const Badge = memo(
28
28
  forwardRef<HTMLDivElement, BadgeProps>(function Badge(
29
- { size = 'm', variant = 'default', truncated ,icon, children, ...rest },
29
+ { size = 'm', variant = 'default', truncated, icon, children, ...rest },
30
30
  forwardedRef
31
31
  ) {
32
32
  return (
@@ -98,6 +98,11 @@ function CheckboxImpl<Checked extends CheckedState>(
98
98
  )
99
99
  }
100
100
 
101
+ /* NOTE: This is a workaround to avoid infinite type recursion when directly using `ReturnType` */
102
+ type ReturnTypeOfCheckboxImpl<Checked extends CheckedState> = ReturnType<
103
+ typeof CheckboxImpl<Checked>
104
+ >
105
+
101
106
  /**
102
107
  * `Checkbox` is a control that allows the user to toggle between checked and not checked.
103
108
  * It can be used with labels or standalone.
@@ -131,4 +136,4 @@ export const Checkbox = forwardRef(CheckboxImpl) as <
131
136
  props: CheckboxProps<Checked> & {
132
137
  ref?: React.ForwardedRef<HTMLButtonElement>
133
138
  }
134
- ) => ReturnType<typeof CheckboxImpl<Checked>>
139
+ ) => ReturnTypeOfCheckboxImpl<Checked>
@@ -1,6 +1,6 @@
1
1
  import { render } from '~/src/utils/test'
2
2
 
3
- import { DIVIDER_TEST_ID, Divider } from './Divider'
3
+ import { Divider } from './Divider'
4
4
  import { type DividerProps } from './Divider.types'
5
5
 
6
6
  import styles from './Divider.module.scss'
@@ -11,8 +11,8 @@ describe('Divider', () => {
11
11
 
12
12
  describe('no props specified', () => {
13
13
  it('should render default Divider', () => {
14
- const { getByTestId } = renderDivider()
15
- const divider = getByTestId(DIVIDER_TEST_ID)
14
+ const { getByRole } = renderDivider()
15
+ const divider = getByRole('separator')
16
16
  expect(divider).toHaveClass(styles.Divider)
17
17
  expect(divider).toHaveAttribute('role', 'separator')
18
18
  })
@@ -20,37 +20,36 @@ describe('Divider', () => {
20
20
 
21
21
  describe('accessibility', () => {
22
22
  it('should render with an separator role', () => {
23
- const { getByTestId } = renderDivider()
24
- const divider = getByTestId(DIVIDER_TEST_ID)
23
+ const { getByRole } = renderDivider()
24
+ const divider = getByRole('separator')
25
25
 
26
26
  expect(divider).toHaveAttribute('role', 'separator')
27
27
  })
28
28
 
29
29
  it('should render horizontal divider without aria-orientation attribute', () => {
30
- const { getByTestId } = renderDivider({
30
+ const { getByRole } = renderDivider({
31
31
  orientation: 'horizontal',
32
32
  })
33
- const divider = getByTestId(DIVIDER_TEST_ID)
33
+ const divider = getByRole('separator')
34
34
 
35
35
  expect(divider).not.toHaveAttribute('aria-orientation')
36
36
  })
37
37
 
38
38
  it('should render vertical divider with aria-orientation attribute', () => {
39
- const { getByTestId } = renderDivider({
39
+ const { getByRole } = renderDivider({
40
40
  orientation: 'vertical',
41
41
  })
42
- const divider = getByTestId(DIVIDER_TEST_ID)
42
+ const divider = getByRole('separator')
43
43
 
44
44
  expect(divider).toHaveAttribute('aria-orientation', 'vertical')
45
45
  })
46
46
 
47
47
  it('should not have aria attributes when decorative is true', () => {
48
- const { getByTestId } = renderDivider({
48
+ const { getByRole } = renderDivider({
49
49
  decorative: true,
50
50
  })
51
- const divider = getByTestId(DIVIDER_TEST_ID)
51
+ const divider = getByRole('separator')
52
52
 
53
- expect(divider).toHaveAttribute('role', 'none')
54
53
  expect(divider).not.toHaveAttribute('aria-orientation')
55
54
  })
56
55
  })
@@ -9,7 +9,10 @@ import { type DividerProps } from './Divider.types'
9
9
 
10
10
  import styles from './Divider.module.scss'
11
11
 
12
- export const DIVIDER_TEST_ID = 'bezier-divider'
12
+ /**
13
+ * @deprecated
14
+ */
15
+ const DIVIDER_TEST_ID = 'bezier-divider'
13
16
 
14
17
  /**
15
18
  * `Divider` is a component to visually or semantically separate content.
@@ -52,6 +55,7 @@ export const Divider = forwardRef<HTMLDivElement, DividerProps>(
52
55
  withoutSideIndent && styles['without-side-indent'],
53
56
  className
54
57
  )}
58
+ role="separator"
55
59
  data-testid={DIVIDER_TEST_ID}
56
60
  {...rest}
57
61
  />
@@ -11,7 +11,10 @@ import { type EmojiProps } from './Emoji.types'
11
11
 
12
12
  import styles from './Emoji.module.scss'
13
13
 
14
- export const EMOJI_TEST_ID = 'bezier-emoji'
14
+ /**
15
+ * @deprecated
16
+ */
17
+ const EMOJI_TEST_ID = 'bezier-emoji'
15
18
 
16
19
  const getEmojiUrl = (name: EmojiProps['name'], size: '160' | '80' | '44') => {
17
20
  return `https://cf${isDev() ? '.exp' : ''}.channel.io/asset/emoji/images/${size}/${encodeURIComponent(name)}.png`
@@ -2,7 +2,7 @@ import { isInaccessible } from '@testing-library/react'
2
2
 
3
3
  import { render } from '~/src/utils/test'
4
4
 
5
- import { FORM_CONTROL_TEST_ID, FormControl } from './FormControl'
5
+ import { FormControl } from './FormControl'
6
6
  import { type FormControlProps } from './FormControl.types'
7
7
  import {
8
8
  MOCK_CONSTS,
@@ -34,44 +34,6 @@ describe('FormControl >', () => {
34
34
  </FormControl>
35
35
  )
36
36
 
37
- describe('Snapshot >', () => {
38
- it('With single field', () => {
39
- const { getByTestId } = renderComponent({
40
- children: SingleFieldForm,
41
- })
42
-
43
- const rendered = getByTestId(FORM_CONTROL_TEST_ID)
44
- expect(rendered).toMatchSnapshot()
45
- })
46
-
47
- it('With single field and left label position', () => {
48
- const { getByTestId } = renderComponent({
49
- labelPosition: 'left',
50
- children: SingleFieldForm,
51
- })
52
-
53
- const rendered = getByTestId(FORM_CONTROL_TEST_ID)
54
- expect(rendered).toMatchSnapshot()
55
- })
56
-
57
- it('With multiple field', () => {
58
- const { container } = renderComponent({
59
- children: MultipleFieldForm,
60
- })
61
-
62
- expect(container).toMatchSnapshot()
63
- })
64
-
65
- it('With multiple field and left label position', () => {
66
- const { container } = renderComponent({
67
- labelPosition: 'left',
68
- children: MultipleFieldForm,
69
- })
70
-
71
- expect(container).toMatchSnapshot()
72
- })
73
- })
74
-
75
37
  describe('Accessibility >', () => {
76
38
  it('With single field', () => {
77
39
  const { container } = renderComponent({
@@ -36,7 +36,7 @@ const [FormControlContextProvider, useFormControlContext] = createContext<
36
36
 
37
37
  export { useFormControlContext }
38
38
 
39
- export const FORM_CONTROL_TEST_ID = 'bezier-form-control'
39
+ const FORM_CONTROL_TEST_ID = 'bezier-form-control'
40
40
 
41
41
  const Container = forwardRef<HTMLElement, ContainerProps>(function Container(
42
42
  { labelPosition, children, className, ...rest },
@@ -1,11 +1,6 @@
1
1
  import { render } from '~/src/utils/test'
2
2
 
3
- import {
4
- FORM_ERROR_MESSAGE_TEST_ID,
5
- FORM_HELPER_TEXT_TEST_ID,
6
- FormErrorMessage,
7
- FormHelperText,
8
- } from './FormHelperText'
3
+ import { FormErrorMessage, FormHelperText } from './FormHelperText'
9
4
  import type {
10
5
  FormErrorMessageProps,
11
6
  FormHelperTextProps,
@@ -30,23 +25,16 @@ describe('FormHelperText >', () => {
30
25
  />
31
26
  )
32
27
 
33
- it('Snapshot >', () => {
34
- const { getByTestId } = renderFormHelperText()
35
- const helperText = getByTestId(FORM_HELPER_TEXT_TEST_ID)
36
-
37
- expect(helperText).toMatchSnapshot()
38
- })
39
-
40
28
  it('renders text when children prop is not empty', () => {
41
- const { getByTestId } = renderFormHelperText()
42
- const helperText = getByTestId(FORM_HELPER_TEXT_TEST_ID)
29
+ const { getByText } = renderFormHelperText()
30
+ const helperText = getByText(text)
43
31
 
44
32
  expect(helperText).toBeInTheDocument()
45
33
  })
46
34
 
47
35
  it('renders nothing when children prop is empty', () => {
48
- const { queryByTestId } = renderFormHelperText({ children: '' })
49
- const helperText = queryByTestId(FORM_HELPER_TEXT_TEST_ID)
36
+ const { queryByText } = renderFormHelperText({ children: '' })
37
+ const helperText = queryByText(text)
50
38
 
51
39
  expect(helperText).toBeNull()
52
40
  })
@@ -71,30 +59,23 @@ describe('FormErrorMessage >', () => {
71
59
  />
72
60
  )
73
61
 
74
- it('Snapshot >', () => {
75
- const { getByTestId } = renderFormHelperText()
76
- const rendered = getByTestId(FORM_ERROR_MESSAGE_TEST_ID)
77
-
78
- expect(rendered).toMatchSnapshot()
79
- })
80
-
81
62
  it('renders text when children prop is not empty', () => {
82
- const { getByTestId } = renderFormHelperText()
83
- const rendered = getByTestId(FORM_ERROR_MESSAGE_TEST_ID)
63
+ const { getByText } = renderFormHelperText()
64
+ const rendered = getByText(text)
84
65
 
85
66
  expect(rendered).toBeInTheDocument()
86
67
  })
87
68
 
88
69
  it('renders nothing when children prop is empty', () => {
89
- const { queryByTestId } = renderFormHelperText({ children: '' })
90
- const rendered = queryByTestId(FORM_ERROR_MESSAGE_TEST_ID)
70
+ const { queryByText } = renderFormHelperText({ children: '' })
71
+ const rendered = queryByText(text)
91
72
 
92
73
  expect(rendered).toBeNull()
93
74
  })
94
75
 
95
76
  it('should have aria-live="polite" attribute', () => {
96
- const { getByTestId } = renderFormHelperText()
97
- const rendered = getByTestId(FORM_ERROR_MESSAGE_TEST_ID)
77
+ const { getByText } = renderFormHelperText()
78
+ const rendered = getByText(text)
98
79
 
99
80
  expect(rendered).toHaveAttribute('aria-live', 'polite')
100
81
  })
@@ -19,8 +19,15 @@ import type {
19
19
 
20
20
  import styles from './FormHelperText.module.scss'
21
21
 
22
- export const FORM_HELPER_TEXT_TEST_ID = 'bezier-form-helper-text'
23
- export const FORM_ERROR_MESSAGE_TEST_ID = 'bezier-form-error-message'
22
+ /**
23
+ * @deprecated
24
+ */
25
+ const FORM_HELPER_TEXT_TEST_ID = 'bezier-form-helper-text'
26
+
27
+ /**
28
+ * @deprecated
29
+ */
30
+ const FORM_ERROR_MESSAGE_TEST_ID = 'bezier-form-error-message'
24
31
 
25
32
  const BaseHelperText = forwardRef<HTMLSpanElement, BaseHelperTextProps>(
26
33
  function BaseHelperText(props, forwardedRef) {
@@ -23,13 +23,6 @@ describe('FormLabel >', () => {
23
23
  />
24
24
  )
25
25
 
26
- it('Snapshot >', () => {
27
- const { getByTestId } = renderComponent()
28
- const rendered = getByTestId(FORM_LABEL_TEST_ID)
29
-
30
- expect(rendered).toMatchSnapshot()
31
- })
32
-
33
26
  it('renders text when children prop is not empty', () => {
34
27
  const { getByTestId } = renderComponent()
35
28
  const rendered = getByTestId(FORM_LABEL_TEST_ID)
@@ -20,20 +20,6 @@ describe('Help >', () => {
20
20
  />
21
21
  )
22
22
 
23
- it('Snapshot >', () => {
24
- const { getByTestId } = renderComponent()
25
- const rendered = getByTestId(HELP_TEST_ID)
26
-
27
- expect(rendered).toMatchSnapshot()
28
- })
29
-
30
- it('renders text when children prop is not empty', () => {
31
- const { getByTestId } = renderComponent()
32
- const rendered = getByTestId(HELP_TEST_ID)
33
-
34
- expect(rendered).toBeInTheDocument()
35
- })
36
-
37
23
  it('renders nothing when children prop is empty', () => {
38
24
  const { queryByTestId } = renderComponent({ children: '' })
39
25
  const rendered = queryByTestId(HELP_TEST_ID)
@@ -42,18 +42,6 @@ describe('Tooltip test >', () => {
42
42
  />
43
43
  )
44
44
 
45
- it('Tooltip with default props', () => {
46
- const { baseElement, getByTestId } = renderTooltip()
47
-
48
- act(() => {
49
- fireEvent.mouseOver(getByTestId(TOOLTIP_TEST_ID))
50
-
51
- jest.runAllTimers()
52
- })
53
-
54
- expect(baseElement).toMatchSnapshot()
55
- })
56
-
57
45
  it('TooltipContent not rendered at first', async () => {
58
46
  const { queryByTestId } = renderTooltip()
59
47
 
@@ -157,6 +157,7 @@ describe('Modal', () => {
157
157
  it("should have proper 'aria-labelledby' attribute (only title)", () => {
158
158
  const { getByRole } = renderOpenedModal({
159
159
  modalHeaderProps: { title: TITLE_TEXT, subtitle: null },
160
+ modalContentProps: { 'aria-describedby': undefined },
160
161
  })
161
162
  expect(getByRole('dialog', { name: TITLE_TEXT })).toBeInTheDocument()
162
163
  })
@@ -164,6 +165,7 @@ describe('Modal', () => {
164
165
  it("should have proper 'aria-labelledby' attribute (hidden title)", () => {
165
166
  const { getByRole } = renderOpenedModal({
166
167
  modalHeaderProps: { title: TITLE_TEXT, subtitle: null, hidden: true },
168
+ modalContentProps: { 'aria-describedby': undefined },
167
169
  })
168
170
  expect(getByRole('dialog', { name: TITLE_TEXT })).toBeInTheDocument()
169
171
  })
@@ -248,6 +250,7 @@ describe('Modal', () => {
248
250
 
249
251
  it("should be visually hidden when the 'hidden' prop is true", () => {
250
252
  const { queryByRole } = renderOpenedModal({
253
+ modalContentProps: { 'aria-describedby': undefined },
251
254
  modalHeaderProps: { title: TITLE_TEXT, hidden: true },
252
255
  })
253
256
  /**
@@ -330,7 +333,11 @@ describe('Modal', () => {
330
333
  <ModalTrigger>
331
334
  <button type="button">{TRIGGER_TEXT}</button>
332
335
  </ModalTrigger>
333
- <ModalContent>
336
+ <ModalContent aria-describedby={undefined}>
337
+ <ModalHeader
338
+ hidden
339
+ title={TITLE_TEXT}
340
+ />
334
341
  <ModalBody>
335
342
  <input type="text" />
336
343
  </ModalBody>
@@ -21,8 +21,15 @@ import type { NavGroupProps } from './NavGroup.types'
21
21
 
22
22
  import styles from './NavGroup.module.scss'
23
23
 
24
- export const NAV_GROUP_TEST_ID = 'bezier-nav-group'
25
- export const NAV_GROUP_LEFT_ICON_TEST_ID = 'bezier-nav-group-left-icon'
24
+ /**
25
+ * @deprecated
26
+ */
27
+ const NAV_GROUP_TEST_ID = 'bezier-nav-group'
28
+
29
+ /**
30
+ * @deprecated
31
+ */
32
+ const NAV_GROUP_LEFT_ICON_TEST_ID = 'bezier-nav-group-left-icon'
26
33
 
27
34
  export const NavGroup = forwardRef<HTMLButtonElement, NavGroupProps>(
28
35
  function NavGroup(
@@ -11,8 +11,15 @@ import type { NavItemProps } from './NavItem.types'
11
11
 
12
12
  import styles from './NavItem.module.scss'
13
13
 
14
- export const NAV_ITEM_TEST_ID = 'bezier-nav-item'
15
- export const NAV_ITEM_LEFT_ICON_TEST_ID = 'bezier-nav-item-left-icon'
14
+ /**
15
+ * @deprecated
16
+ */
17
+ const NAV_ITEM_TEST_ID = 'bezier-nav-item'
18
+
19
+ /**
20
+ * @deprecated
21
+ */
22
+ const NAV_ITEM_LEFT_ICON_TEST_ID = 'bezier-nav-item-left-icon'
16
23
 
17
24
  /**
18
25
  * `NavItem` is a component for an item where you can navigate to another link.
@@ -1,4 +1,4 @@
1
- import { isInaccessible, waitFor } from '@testing-library/react'
1
+ import { isInaccessible } from '@testing-library/react'
2
2
  import userEvent from '@testing-library/user-event'
3
3
 
4
4
  import { render } from '~/src/utils/test'
@@ -16,13 +16,6 @@ describe('Slider', () => {
16
16
  user = userEvent.setup()
17
17
  })
18
18
 
19
- describe('Snapshot', () => {
20
- it('should match snapshot', () => {
21
- const { container } = renderSlider({ defaultValue: [5], guide: [5] })
22
- expect(container).toMatchSnapshot()
23
- })
24
- })
25
-
26
19
  describe('ARIA', () => {
27
20
  it('should be accessible', () => {
28
21
  const { container } = renderSlider()
@@ -9,11 +9,6 @@ describe('SmoothCornersBox', () => {
9
9
  ) => render(<SmoothCornersBox {...rest}>{children}</SmoothCornersBox>)
10
10
 
11
11
  describe('Style', () => {
12
- it('snapshot with default value', () => {
13
- const { container } = renderSmoothCornersBox()
14
- expect(container).toMatchSnapshot()
15
- })
16
-
17
12
  it('each style property must have the correct unit.', () => {
18
13
  const children = 'foo'
19
14
  const { getByText } = renderSmoothCornersBox({