@testspectra/cli 1.1.8-rc.5 → 1.1.8-rc.6

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 (187) hide show
  1. package/README.md +47 -0
  2. package/bin/{testspectra-runner.exe → testspectra-runner} +0 -0
  3. package/dist/.tsbuildinfo +1 -1
  4. package/dist/commands/__tests__/run-e2e.test.js +49 -49
  5. package/dist/commands/init.js +148 -148
  6. package/dist/index.js +11 -11
  7. package/dist/linter/__tests__/component-test-imports.test.js +51 -51
  8. package/dist/linter/__tests__/spec-schema.test.js +167 -167
  9. package/dist/linter/schemas/spec.schema.d.ts +2 -2
  10. package/dist/linter/schemas/suite.schema.d.ts +4 -4
  11. package/dist/runner/bridge.js +43 -4
  12. package/package.json +35 -28
  13. package/templates/default/CLAUDE.md +16 -16
  14. package/templates/default/global-hooks/after/mobile.hook.ts +3 -3
  15. package/templates/default/global-hooks/after/web.hook.ts +3 -3
  16. package/templates/default/global-hooks/before/mobile.hook.ts +3 -3
  17. package/templates/default/global-hooks/before/web.hook.ts +3 -3
  18. package/templates/default/package.json +2 -2
  19. package/templates/default/page-objects/AuthPage/mobile.ts +5 -5
  20. package/templates/default/page-objects/AuthPage/web.ts +10 -10
  21. package/templates/default/page-objects/MatchersPage/mobile.ts +70 -70
  22. package/templates/default/page-objects/MatchersPage/web.ts +43 -43
  23. package/templates/default/page-objects/NavigationPage/mobile.ts +14 -14
  24. package/templates/default/page-objects/NavigationPage/web.ts +8 -8
  25. package/templates/default/page-objects/PlaygroundPage/mobile.ts +42 -42
  26. package/templates/default/page-objects/PlaygroundPage/web.ts +31 -31
  27. package/templates/default/specs/ApiInterception/TC-0008-fetch-mocking/mobile.test.ts +53 -53
  28. package/templates/default/specs/ApiInterception/TC-0008-fetch-mocking/spec.md +19 -19
  29. package/templates/default/specs/ApiInterception/TC-0008-fetch-mocking/web.test.ts +31 -31
  30. package/templates/default/specs/ApiInterception/TC-0009-post-mocking/android.test.ts +3 -3
  31. package/templates/default/specs/ApiInterception/TC-0009-post-mocking/common.test.ts +3 -3
  32. package/templates/default/specs/ApiInterception/TC-0009-post-mocking/mobile.test.ts +27 -27
  33. package/templates/default/specs/ApiInterception/TC-0009-post-mocking/spec.md +19 -19
  34. package/templates/default/specs/ApiInterception/TC-0009-post-mocking/web.test.ts +26 -26
  35. package/templates/default/specs/ApiInterception/TC-0012-direct-and-late-response/common.test.ts +30 -30
  36. package/templates/default/specs/ApiInterception/TC-0012-direct-and-late-response/spec.md +22 -22
  37. package/templates/default/specs/ApiInterception/TC-0013-real-network-call-recorded/common.test.ts +27 -27
  38. package/templates/default/specs/ApiInterception/TC-0013-real-network-call-recorded/spec.md +20 -20
  39. package/templates/default/specs/ApiInterception/TC-0015-mock-server-sent-events/spec.md +24 -24
  40. package/templates/default/specs/ApiInterception/TC-0015-mock-server-sent-events/web.test.ts +26 -26
  41. package/templates/default/specs/ApiInterception/TC-0016-bypass-websocket-with-app-level-mock/spec.md +37 -37
  42. package/templates/default/specs/ApiInterception/TC-0016-bypass-websocket-with-app-level-mock/web.test.ts +21 -21
  43. package/templates/default/specs/ApiInterception/TC-0017-bypass-captcha-with-test-mode-flag/spec.md +29 -29
  44. package/templates/default/specs/ApiInterception/TC-0017-bypass-captcha-with-test-mode-flag/web.test.ts +16 -16
  45. package/templates/default/specs/ApiInterception/suite.md +10 -10
  46. package/templates/default/specs/ApiSeeding/TC-0014-seed-and-cleanup-via-hooks/common.test.ts +30 -30
  47. package/templates/default/specs/ApiSeeding/TC-0014-seed-and-cleanup-via-hooks/spec.md +23 -23
  48. package/templates/default/specs/ApiSeeding/hooks/after/common.hook.ts +16 -16
  49. package/templates/default/specs/ApiSeeding/hooks/before/common.hook.ts +28 -28
  50. package/templates/default/specs/ApiSeeding/suite.md +9 -9
  51. package/templates/default/specs/Authentication/TC-0021-seed-authenticated-session/mobile.test.ts +7 -7
  52. package/templates/default/specs/Authentication/TC-0021-seed-authenticated-session/spec.md +19 -19
  53. package/templates/default/specs/Authentication/TC-0021-seed-authenticated-session/web.test.ts +9 -9
  54. package/templates/default/specs/Authentication/suite.md +9 -9
  55. package/templates/default/specs/BrowserContext/TC-0007-title-and-navigation/mobile.test.ts +9 -9
  56. package/templates/default/specs/BrowserContext/TC-0007-title-and-navigation/spec.md +17 -17
  57. package/templates/default/specs/BrowserContext/TC-0007-title-and-navigation/web.test.ts +19 -19
  58. package/templates/default/specs/BrowserContext/TC-0022-history-navigation/mobile.test.ts +17 -17
  59. package/templates/default/specs/BrowserContext/TC-0022-history-navigation/spec.md +28 -28
  60. package/templates/default/specs/BrowserContext/TC-0022-history-navigation/web.test.ts +26 -26
  61. package/templates/default/specs/ContentMatchers/TC-0005-text-and-values/common.test.ts +26 -26
  62. package/templates/default/specs/ContentMatchers/TC-0005-text-and-values/spec.md +19 -19
  63. package/templates/default/specs/ContentMatchers/TC-0006-collections-and-empty/mobile.test.ts +11 -11
  64. package/templates/default/specs/ContentMatchers/TC-0006-collections-and-empty/spec.md +17 -17
  65. package/templates/default/specs/ContentMatchers/TC-0006-collections-and-empty/web.test.ts +11 -11
  66. package/templates/default/specs/ContentMatchers/TC-0020-scoped-element-access/common.test.ts +14 -14
  67. package/templates/default/specs/ContentMatchers/TC-0020-scoped-element-access/spec.md +21 -21
  68. package/templates/default/specs/DeepLink/TC-0018-navigate-via-deep-link/mobile.test.ts +28 -28
  69. package/templates/default/specs/DeepLink/TC-0018-navigate-via-deep-link/spec.md +29 -29
  70. package/templates/default/specs/DeepLink/suite.md +9 -9
  71. package/templates/default/specs/ElementMatchers/TC-0003-visibility-and-dom/mobile.test.ts +11 -11
  72. package/templates/default/specs/ElementMatchers/TC-0003-visibility-and-dom/spec.md +17 -17
  73. package/templates/default/specs/ElementMatchers/TC-0003-visibility-and-dom/web.test.ts +11 -11
  74. package/templates/default/specs/ElementMatchers/TC-0004-states-and-attributes/mobile.test.ts +29 -29
  75. package/templates/default/specs/ElementMatchers/TC-0004-states-and-attributes/spec.md +19 -19
  76. package/templates/default/specs/ElementMatchers/TC-0004-states-and-attributes/web.test.ts +29 -29
  77. package/templates/default/specs/ElementMatchers/suite.md +10 -10
  78. package/templates/default/specs/EnvironmentConfig/TC-0019-read-custom-environment-variable/common.test.ts +5 -5
  79. package/templates/default/specs/EnvironmentConfig/TC-0019-read-custom-environment-variable/spec.md +16 -16
  80. package/templates/default/specs/EnvironmentConfig/suite.md +9 -9
  81. package/templates/default/specs/PermissionRationale/TC-0010-camera-permission-allow/mobile.test.ts +26 -26
  82. package/templates/default/specs/PermissionRationale/TC-0010-camera-permission-allow/spec.md +22 -22
  83. package/templates/default/specs/PermissionRationale/TC-0011-camera-permission-deny/mobile.test.ts +13 -13
  84. package/templates/default/specs/PermissionRationale/TC-0011-camera-permission-deny/spec.md +20 -20
  85. package/templates/default/specs/PermissionRationale/suite.md +9 -9
  86. package/templates/default/specs/Playground/TC-0001-form-controls/mobile.test.ts +6 -6
  87. package/templates/default/specs/Playground/TC-0001-form-controls/spec.md +18 -18
  88. package/templates/default/specs/Playground/TC-0001-form-controls/web.test.ts +6 -6
  89. package/templates/default/specs/Playground/TC-0002-toggle-elements/mobile.test.ts +6 -6
  90. package/templates/default/specs/Playground/TC-0002-toggle-elements/spec.md +18 -18
  91. package/templates/default/specs/Playground/TC-0002-toggle-elements/web.test.ts +6 -6
  92. package/templates/default/spectra.config.ts +52 -52
  93. package/templates/default/support/actions/fillCredentials/mobile.action.ts +4 -4
  94. package/templates/default/support/actions/fillCredentials/web.action.ts +4 -4
  95. package/templates/default/support/actions/seedSession/mobile.action.ts +9 -9
  96. package/templates/default/support/actions/seedSession/web.action.ts +13 -13
  97. package/templates/default/support/steps/togglePlaygroundStates/mobile.step.ts +5 -5
  98. package/templates/default/support/steps/togglePlaygroundStates/web.step.ts +5 -5
  99. package/templates/default/support/steps/verifyPlaygroundState/mobile.step.ts +6 -6
  100. package/templates/default/support/steps/verifyPlaygroundState/web.step.ts +6 -6
  101. package/templates/nx/.nx/workspace-data/{59842386-c7c4-44ca-b2c2-20e1700bd13d.db-shm → 70094CFD-E89B-57A1-9619-2FC5F4963C54.db-shm} +0 -0
  102. package/templates/nx/.nx/workspace-data/{59842386-c7c4-44ca-b2c2-20e1700bd13d.db-wal → 70094CFD-E89B-57A1-9619-2FC5F4963C54.db-wal} +0 -0
  103. package/templates/nx/.nx/workspace-data/d/daemon.log +5489 -1737
  104. package/templates/nx/.nx/workspace-data/d/server-process.json +1 -1
  105. package/templates/nx/.nx/workspace-data/file-map.json +109 -109
  106. package/templates/nx/.nx/workspace-data/lockfile.hash +1 -1
  107. package/templates/nx/.nx/workspace-data/nx_files.nxt +0 -0
  108. package/templates/nx/.nx/workspace-data/parsed-lock-file.json +535 -535
  109. package/templates/nx/.nx/workspace-data/project-graph.json +584 -584
  110. package/templates/nx/CLAUDE.md +10 -10
  111. package/templates/nx/package.json +2 -2
  112. package/templates/nx/packages/matchers/e2e/specs/ApiInterception/TC-0008-fetch-mocking/mobile.test.ts +27 -27
  113. package/templates/nx/packages/matchers/e2e/specs/ApiInterception/TC-0008-fetch-mocking/web.test.ts +27 -27
  114. package/templates/nx/packages/matchers/e2e/specs/ApiInterception/TC-0009-post-mocking/mobile.test.ts +24 -24
  115. package/templates/nx/packages/matchers/e2e/specs/ApiInterception/TC-0009-post-mocking/web.test.ts +24 -24
  116. package/templates/nx/packages/matchers/e2e/specs/BrowserContext/TC-0007-title-and-navigation/mobile.test.ts +3 -3
  117. package/templates/nx/packages/matchers/e2e/specs/BrowserContext/TC-0007-title-and-navigation/web.test.ts +19 -19
  118. package/templates/nx/packages/matchers/e2e/specs/ContentMatchers/TC-0005-text-and-values/mobile.test.ts +3 -3
  119. package/templates/nx/packages/matchers/e2e/specs/ContentMatchers/TC-0005-text-and-values/web.test.ts +17 -17
  120. package/templates/nx/packages/matchers/e2e/specs/ContentMatchers/TC-0006-collections-and-empty/mobile.test.ts +3 -3
  121. package/templates/nx/packages/matchers/e2e/specs/ContentMatchers/TC-0006-collections-and-empty/web.test.ts +11 -11
  122. package/templates/nx/packages/matchers/e2e/specs/ElementMatchers/TC-0003-visibility-and-dom/mobile.test.ts +3 -3
  123. package/templates/nx/packages/matchers/e2e/specs/ElementMatchers/TC-0003-visibility-and-dom/web.test.ts +11 -11
  124. package/templates/nx/packages/matchers/e2e/specs/ElementMatchers/TC-0004-states-and-attributes/mobile.test.ts +3 -3
  125. package/templates/nx/packages/matchers/e2e/specs/ElementMatchers/TC-0004-states-and-attributes/web.test.ts +29 -29
  126. package/templates/nx/packages/matchers/e2e/specs/EnvironmentConfig/TC-0019-read-custom-environment-variable/common.test.ts +5 -5
  127. package/templates/nx/packages/matchers/e2e/specs/EnvironmentConfig/TC-0019-read-custom-environment-variable/spec.md +16 -16
  128. package/templates/nx/packages/matchers/e2e/specs/EnvironmentConfig/suite.md +9 -9
  129. package/templates/nx/packages/playground/e2e/specs/Playground/TC-0001-form-controls/mobile.test.ts +3 -3
  130. package/templates/nx/packages/playground/e2e/specs/Playground/TC-0001-form-controls/web.test.ts +6 -6
  131. package/templates/nx/packages/playground/e2e/specs/Playground/TC-0002-toggle-elements/mobile.test.ts +3 -3
  132. package/templates/nx/packages/playground/e2e/specs/Playground/TC-0002-toggle-elements/web.test.ts +6 -6
  133. package/templates/nx/pnpm-lock.yaml +6663 -6663
  134. package/templates/nx/pnpm-workspace.yaml +9 -9
  135. package/templates/nx/shared/testing/page-objects/MatchersPage/mobile.ts +33 -33
  136. package/templates/nx/shared/testing/page-objects/MatchersPage/web.ts +91 -91
  137. package/templates/nx/shared/testing/page-objects/NavigationPage/mobile.ts +5 -5
  138. package/templates/nx/shared/testing/page-objects/NavigationPage/web.ts +8 -8
  139. package/templates/nx/shared/testing/page-objects/PlaygroundPage/mobile.ts +26 -26
  140. package/templates/nx/shared/testing/page-objects/PlaygroundPage/web.ts +31 -31
  141. package/templates/nx/shared/testing/project.json +19 -19
  142. package/templates/nx/shared/testing/support/actions/fillCredentials/mobile.action.ts +4 -4
  143. package/templates/nx/shared/testing/support/actions/fillCredentials/web.action.ts +4 -4
  144. package/templates/nx/shared/testing/support/steps/togglePlaygroundStates/mobile.step.ts +3 -3
  145. package/templates/nx/shared/testing/support/steps/togglePlaygroundStates/web.step.ts +5 -5
  146. package/templates/nx/shared/testing/support/steps/verifyPlaygroundState/mobile.step.ts +4 -4
  147. package/templates/nx/shared/testing/support/steps/verifyPlaygroundState/web.step.ts +6 -6
  148. package/templates/nx/spectra.config.ts +52 -52
  149. package/templates/react-component/.cursorrules +17 -17
  150. package/templates/react-component/.vscode/extensions.json +5 -5
  151. package/templates/react-component/CLAUDE.md +14 -14
  152. package/templates/react-component/README.md +69 -69
  153. package/templates/react-component/fixtures/component-mock.json +12 -12
  154. package/templates/react-component/global-hooks/after/web.hook.ts +3 -3
  155. package/templates/react-component/global-hooks/before/web.hook.ts +3 -3
  156. package/templates/react-component/package.json +27 -27
  157. package/templates/react-component/page-objects/BadgeComponent/web.ts +23 -23
  158. package/templates/react-component/page-objects/ButtonComponent/web.ts +23 -23
  159. package/templates/react-component/page-objects/InputComponent/web.ts +13 -13
  160. package/templates/react-component/specs/BadgeComponent/TC-0002-badge-severities-and-dot/spec.md +18 -18
  161. package/templates/react-component/specs/BadgeComponent/TC-0002-badge-severities-and-dot/web.test.tsx +11 -11
  162. package/templates/react-component/specs/BadgeComponent/TC-0006-badge-success-with-dot/spec.md +18 -18
  163. package/templates/react-component/specs/BadgeComponent/TC-0006-badge-success-with-dot/web.test.tsx +10 -10
  164. package/templates/react-component/specs/BadgeComponent/TC-0007-badge-by-severity-lookup/spec.md +18 -18
  165. package/templates/react-component/specs/BadgeComponent/TC-0007-badge-by-severity-lookup/web.test.tsx +16 -16
  166. package/templates/react-component/specs/BadgeComponent/suite.md +12 -12
  167. package/templates/react-component/specs/ButtonComponent/TC-0001-button-rendering-and-click/spec.md +19 -19
  168. package/templates/react-component/specs/ButtonComponent/TC-0001-button-rendering-and-click/web.test.tsx +28 -28
  169. package/templates/react-component/specs/ButtonComponent/TC-0004-disabled-button-not-clickable/spec.md +19 -19
  170. package/templates/react-component/specs/ButtonComponent/TC-0004-disabled-button-not-clickable/web.test.tsx +22 -22
  171. package/templates/react-component/specs/ButtonComponent/TC-0005-button-renders-icon/spec.md +18 -18
  172. package/templates/react-component/specs/ButtonComponent/TC-0005-button-renders-icon/web.test.tsx +8 -8
  173. package/templates/react-component/specs/ButtonComponent/suite.md +12 -12
  174. package/templates/react-component/specs/InputComponent/TC-0003-input-typing-and-clear/spec.md +20 -20
  175. package/templates/react-component/specs/InputComponent/TC-0003-input-typing-and-clear/web.test.tsx +28 -28
  176. package/templates/react-component/specs/InputComponent/TC-0008-disabled-input-not-editable/spec.md +18 -18
  177. package/templates/react-component/specs/InputComponent/TC-0008-disabled-input-not-editable/web.test.tsx +9 -9
  178. package/templates/react-component/specs/InputComponent/suite.md +12 -12
  179. package/templates/react-component/spectra.config.ts +27 -27
  180. package/templates/react-component/src/components/Badge/Badge.tsx +60 -60
  181. package/templates/react-component/src/components/Button/Button.tsx +57 -57
  182. package/templates/react-component/src/components/Input/Input.tsx +41 -41
  183. package/templates/react-component/src/test-utils.tsx +23 -23
  184. package/templates/react-component/support/actions/fillInputField/web.action.ts +9 -9
  185. package/templates/react-component/support/steps/verifyButtonState/web.step.ts +12 -12
  186. package/bin/.testspectra-runner.hash +0 -1
  187. /package/templates/nx/.nx/workspace-data/{59842386-c7c4-44ca-b2c2-20e1700bd13d.db → 70094CFD-E89B-57A1-9619-2FC5F4963C54.db} +0 -0
@@ -1,57 +1,57 @@
1
- import React from 'react';
2
-
3
- export interface ButtonProps {
4
- label: string;
5
- variant?: 'primary' | 'secondary' | 'danger';
6
- disabled?: boolean;
7
- onClick?: () => void;
8
- icon?: React.ReactNode;
9
- }
10
-
11
- export const Button: React.FC<ButtonProps> = ({
12
- label,
13
- variant = 'primary',
14
- disabled = false,
15
- onClick,
16
- icon,
17
- }) => {
18
- const getBackgroundColor = () => {
19
- if (disabled) return '#9ca3af';
20
- switch (variant) {
21
- case 'secondary':
22
- return '#4b5563';
23
- case 'danger':
24
- return '#ef4444';
25
- case 'primary':
26
- default:
27
- return '#3b82f6';
28
- }
29
- };
30
-
31
- return (
32
- <button
33
- type="button"
34
- data-testid="testspectra-button"
35
- data-variant={variant}
36
- disabled={disabled}
37
- onClick={onClick}
38
- style={{
39
- display: 'inline-flex',
40
- alignItems: 'center',
41
- gap: '8px',
42
- padding: '8px 16px',
43
- borderRadius: '6px',
44
- border: 'none',
45
- backgroundColor: getBackgroundColor(),
46
- color: '#ffffff',
47
- fontWeight: 500,
48
- fontSize: '14px',
49
- cursor: disabled ? 'not-allowed' : 'pointer',
50
- transition: 'background-color 0.2s ease',
51
- }}
52
- >
53
- {icon && <span data-testid="button-icon">{icon}</span>}
54
- <span>{label}</span>
55
- </button>
56
- );
57
- };
1
+ import React from 'react';
2
+
3
+ export interface ButtonProps {
4
+ label: string;
5
+ variant?: 'primary' | 'secondary' | 'danger';
6
+ disabled?: boolean;
7
+ onClick?: () => void;
8
+ icon?: React.ReactNode;
9
+ }
10
+
11
+ export const Button: React.FC<ButtonProps> = ({
12
+ label,
13
+ variant = 'primary',
14
+ disabled = false,
15
+ onClick,
16
+ icon,
17
+ }) => {
18
+ const getBackgroundColor = () => {
19
+ if (disabled) return '#9ca3af';
20
+ switch (variant) {
21
+ case 'secondary':
22
+ return '#4b5563';
23
+ case 'danger':
24
+ return '#ef4444';
25
+ case 'primary':
26
+ default:
27
+ return '#3b82f6';
28
+ }
29
+ };
30
+
31
+ return (
32
+ <button
33
+ type="button"
34
+ data-testid="testspectra-button"
35
+ data-variant={variant}
36
+ disabled={disabled}
37
+ onClick={onClick}
38
+ style={{
39
+ display: 'inline-flex',
40
+ alignItems: 'center',
41
+ gap: '8px',
42
+ padding: '8px 16px',
43
+ borderRadius: '6px',
44
+ border: 'none',
45
+ backgroundColor: getBackgroundColor(),
46
+ color: '#ffffff',
47
+ fontWeight: 500,
48
+ fontSize: '14px',
49
+ cursor: disabled ? 'not-allowed' : 'pointer',
50
+ transition: 'background-color 0.2s ease',
51
+ }}
52
+ >
53
+ {icon && <span data-testid="button-icon">{icon}</span>}
54
+ <span>{label}</span>
55
+ </button>
56
+ );
57
+ };
@@ -1,41 +1,41 @@
1
- import React from 'react';
2
-
3
- export interface InputProps {
4
- placeholder?: string;
5
- value?: string;
6
- defaultValue?: string;
7
- disabled?: boolean;
8
- onChange?: (e: React.ChangeEvent<HTMLInputElement>) => void;
9
- ariaLabel?: string;
10
- }
11
-
12
- export const Input: React.FC<InputProps> = ({
13
- placeholder = '',
14
- value,
15
- defaultValue,
16
- disabled = false,
17
- onChange,
18
- ariaLabel,
19
- }) => {
20
- return (
21
- <input
22
- type="text"
23
- data-testid="testspectra-input"
24
- placeholder={placeholder}
25
- value={value}
26
- defaultValue={defaultValue}
27
- disabled={disabled}
28
- onChange={onChange}
29
- aria-label={ariaLabel}
30
- style={{
31
- padding: '8px 12px',
32
- borderRadius: '6px',
33
- border: '1px solid #d1d5db',
34
- fontSize: '14px',
35
- outline: 'none',
36
- backgroundColor: disabled ? '#f3f4f6' : '#ffffff',
37
- cursor: disabled ? 'not-allowed' : 'text',
38
- }}
39
- />
40
- );
41
- };
1
+ import React from 'react';
2
+
3
+ export interface InputProps {
4
+ placeholder?: string;
5
+ value?: string;
6
+ defaultValue?: string;
7
+ disabled?: boolean;
8
+ onChange?: (e: React.ChangeEvent<HTMLInputElement>) => void;
9
+ ariaLabel?: string;
10
+ }
11
+
12
+ export const Input: React.FC<InputProps> = ({
13
+ placeholder = '',
14
+ value,
15
+ defaultValue,
16
+ disabled = false,
17
+ onChange,
18
+ ariaLabel,
19
+ }) => {
20
+ return (
21
+ <input
22
+ type="text"
23
+ data-testid="testspectra-input"
24
+ placeholder={placeholder}
25
+ value={value}
26
+ defaultValue={defaultValue}
27
+ disabled={disabled}
28
+ onChange={onChange}
29
+ aria-label={ariaLabel}
30
+ style={{
31
+ padding: '8px 12px',
32
+ borderRadius: '6px',
33
+ border: '1px solid #d1d5db',
34
+ fontSize: '14px',
35
+ outline: 'none',
36
+ backgroundColor: disabled ? '#f3f4f6' : '#ffffff',
37
+ cursor: disabled ? 'not-allowed' : 'text',
38
+ }}
39
+ />
40
+ );
41
+ };
@@ -1,23 +1,23 @@
1
- import { ReactElement, ReactNode } from 'react';
2
-
3
- export interface TestProviderProps {
4
- children: ReactNode;
5
- }
6
-
7
- /**
8
- * Common test provider wrapper for components (theme, context, locale). Compose it directly in
9
- * the test file around whatever you pass to `Spectra.mount()` — see
10
- * docs/v2/features/component-testing/react/mount-convention.md §8.
11
- */
12
- export function TestProvider({ children }: TestProviderProps) {
13
- return (
14
- <div className="testspectra-test-root" style={{ padding: '16px', fontFamily: 'system-ui, sans-serif' }}>
15
- {children}
16
- </div>
17
- );
18
- }
19
-
20
- /** Convenience wrapper for `Spectra.mount(withProviders(<Component />))`. */
21
- export function withProviders(children: ReactElement): ReactElement {
22
- return <TestProvider>{children}</TestProvider>;
23
- }
1
+ import { ReactElement, ReactNode } from 'react';
2
+
3
+ export interface TestProviderProps {
4
+ children: ReactNode;
5
+ }
6
+
7
+ /**
8
+ * Common test provider wrapper for components (theme, context, locale). Compose it directly in
9
+ * the test file around whatever you pass to `Spectra.mount()` — see
10
+ * docs/v2/features/component-testing/react/mount-convention.md §8.
11
+ */
12
+ export function TestProvider({ children }: TestProviderProps) {
13
+ return (
14
+ <div className="testspectra-test-root" style={{ padding: '16px', fontFamily: 'system-ui, sans-serif' }}>
15
+ {children}
16
+ </div>
17
+ );
18
+ }
19
+
20
+ /** Convenience wrapper for `Spectra.mount(withProviders(<Component />))`. */
21
+ export function withProviders(children: ReactElement): ReactElement {
22
+ return <TestProvider>{children}</TestProvider>;
23
+ }
@@ -1,9 +1,9 @@
1
- /**
2
- * Custom Spectra Action to clear and fill an input field.
3
- */
4
- export default async function (selector: string, text: string) {
5
- const el = Spectra.get(selector);
6
- await el.shouldBeVisible();
7
- await el.clear();
8
- await el.type(text);
9
- }
1
+ /**
2
+ * Custom Spectra Action to clear and fill an input field.
3
+ */
4
+ export default async function (selector: string, text: string) {
5
+ const el = Spectra.get(selector);
6
+ await el.shouldBeVisible();
7
+ await el.clear();
8
+ await el.type(text);
9
+ }
@@ -1,12 +1,12 @@
1
- /**
2
- * Reusable step to verify button presence and enabled/disabled state.
3
- */
4
- export default async function (label: string, isEnabled = true) {
5
- const btn = Spectra.get(`button*=${label}`);
6
- await btn.shouldBeVisible();
7
- if (isEnabled) {
8
- await btn.shouldBeEnabled();
9
- } else {
10
- await btn.shouldBeDisabled();
11
- }
12
- }
1
+ /**
2
+ * Reusable step to verify button presence and enabled/disabled state.
3
+ */
4
+ export default async function (label: string, isEnabled = true) {
5
+ const btn = Spectra.get(`button*=${label}`);
6
+ await btn.shouldBeVisible();
7
+ if (isEnabled) {
8
+ await btn.shouldBeEnabled();
9
+ } else {
10
+ await btn.shouldBeDisabled();
11
+ }
12
+ }
@@ -1 +0,0 @@
1
- ee8892a6b2c4c19bf5da415da3d29172023c383de2d12c0080b5dc61dc339af3