@testspectra/cli 1.1.8-rc.2 → 1.1.8-rc.20
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/README.md +47 -0
- package/bin/spectra.js +0 -0
- package/dist/.tsbuildinfo +1 -1
- package/dist/commands/__tests__/run-e2e.test.js +49 -49
- package/dist/commands/add.js +2 -1
- package/dist/commands/devices.js +1 -0
- package/dist/commands/doctor.js +1 -0
- package/dist/commands/init.js +150 -149
- package/dist/commands/install.js +2 -0
- package/dist/commands/license.js +1 -0
- package/dist/commands/test.js +5 -3
- package/dist/generator/__tests__/tsconfig-isolation.test.js +2 -1
- package/dist/generator/__tests__/type-generator.test.js +38 -0
- package/dist/generator/tsconfig-generator.js +1 -1
- package/dist/generator/type-generator.d.ts +5 -2
- package/dist/generator/type-generator.js +14 -17
- package/dist/index.js +11 -11
- package/dist/linter/__tests__/component-test-imports.test.js +51 -51
- package/dist/linter/__tests__/shared-lib-boundary.test.js +15 -15
- package/dist/linter/__tests__/spec-schema.test.js +167 -167
- package/dist/linter/discovery.d.ts +3 -3
- package/dist/linter/discovery.js +5 -5
- package/dist/linter/schemas/spec.schema.d.ts +2 -2
- package/dist/linter/schemas/suite.schema.d.ts +4 -4
- package/dist/runner/bridge.js +53 -4
- package/package.json +34 -29
- package/templates/default/CLAUDE.md +16 -16
- package/templates/default/global-hooks/after/mobile.hook.ts +3 -3
- package/templates/default/global-hooks/after/web.hook.ts +3 -3
- package/templates/default/global-hooks/before/mobile.hook.ts +3 -3
- package/templates/default/global-hooks/before/web.hook.ts +3 -3
- package/templates/default/package.json +2 -2
- package/templates/default/page-objects/AuthPage/mobile.ts +5 -5
- package/templates/default/page-objects/AuthPage/web.ts +10 -10
- package/templates/default/page-objects/MatchersPage/mobile.ts +70 -70
- package/templates/default/page-objects/MatchersPage/web.ts +43 -43
- package/templates/default/page-objects/NavigationPage/mobile.ts +14 -14
- package/templates/default/page-objects/NavigationPage/web.ts +8 -8
- package/templates/default/page-objects/PlaygroundPage/mobile.ts +42 -42
- package/templates/default/page-objects/PlaygroundPage/web.ts +31 -31
- package/templates/default/specs/ApiInterception/TC-0008-fetch-mocking/mobile.test.ts +53 -53
- package/templates/default/specs/ApiInterception/TC-0008-fetch-mocking/spec.md +19 -19
- package/templates/default/specs/ApiInterception/TC-0008-fetch-mocking/web.test.ts +31 -31
- package/templates/default/specs/ApiInterception/TC-0009-post-mocking/android.test.ts +3 -3
- package/templates/default/specs/ApiInterception/TC-0009-post-mocking/common.test.ts +3 -3
- package/templates/default/specs/ApiInterception/TC-0009-post-mocking/mobile.test.ts +27 -27
- package/templates/default/specs/ApiInterception/TC-0009-post-mocking/spec.md +19 -19
- package/templates/default/specs/ApiInterception/TC-0009-post-mocking/web.test.ts +26 -26
- package/templates/default/specs/ApiInterception/TC-0012-direct-and-late-response/common.test.ts +30 -30
- package/templates/default/specs/ApiInterception/TC-0012-direct-and-late-response/spec.md +22 -22
- package/templates/default/specs/ApiInterception/TC-0013-real-network-call-recorded/common.test.ts +27 -27
- package/templates/default/specs/ApiInterception/TC-0013-real-network-call-recorded/spec.md +20 -20
- package/templates/default/specs/ApiInterception/TC-0015-mock-server-sent-events/spec.md +24 -24
- package/templates/default/specs/ApiInterception/TC-0015-mock-server-sent-events/web.test.ts +26 -26
- package/templates/default/specs/ApiInterception/TC-0016-bypass-websocket-with-app-level-mock/spec.md +37 -37
- package/templates/default/specs/ApiInterception/TC-0016-bypass-websocket-with-app-level-mock/web.test.ts +21 -21
- package/templates/default/specs/ApiInterception/TC-0017-bypass-captcha-with-test-mode-flag/spec.md +29 -29
- package/templates/default/specs/ApiInterception/TC-0017-bypass-captcha-with-test-mode-flag/web.test.ts +16 -16
- package/templates/default/specs/ApiInterception/suite.md +10 -10
- package/templates/default/specs/ApiSeeding/TC-0014-seed-and-cleanup-via-hooks/common.test.ts +30 -30
- package/templates/default/specs/ApiSeeding/TC-0014-seed-and-cleanup-via-hooks/spec.md +23 -23
- package/templates/default/specs/ApiSeeding/hooks/after/common.hook.ts +16 -16
- package/templates/default/specs/ApiSeeding/hooks/before/common.hook.ts +28 -28
- package/templates/default/specs/ApiSeeding/suite.md +9 -9
- package/templates/default/specs/Authentication/TC-0021-seed-authenticated-session/mobile.test.ts +7 -7
- package/templates/default/specs/Authentication/TC-0021-seed-authenticated-session/spec.md +19 -19
- package/templates/default/specs/Authentication/TC-0021-seed-authenticated-session/web.test.ts +9 -9
- package/templates/default/specs/Authentication/suite.md +9 -9
- package/templates/default/specs/BrowserContext/TC-0007-title-and-navigation/mobile.test.ts +9 -9
- package/templates/default/specs/BrowserContext/TC-0007-title-and-navigation/spec.md +17 -17
- package/templates/default/specs/BrowserContext/TC-0007-title-and-navigation/web.test.ts +19 -19
- package/templates/default/specs/BrowserContext/TC-0022-history-navigation/mobile.test.ts +17 -17
- package/templates/default/specs/BrowserContext/TC-0022-history-navigation/spec.md +28 -28
- package/templates/default/specs/BrowserContext/TC-0022-history-navigation/web.test.ts +26 -26
- package/templates/default/specs/ContentMatchers/TC-0005-text-and-values/common.test.ts +26 -26
- package/templates/default/specs/ContentMatchers/TC-0005-text-and-values/spec.md +19 -19
- package/templates/default/specs/ContentMatchers/TC-0006-collections-and-empty/mobile.test.ts +11 -11
- package/templates/default/specs/ContentMatchers/TC-0006-collections-and-empty/spec.md +17 -17
- package/templates/default/specs/ContentMatchers/TC-0006-collections-and-empty/web.test.ts +11 -11
- package/templates/default/specs/ContentMatchers/TC-0020-scoped-element-access/common.test.ts +14 -14
- package/templates/default/specs/ContentMatchers/TC-0020-scoped-element-access/spec.md +21 -21
- package/templates/default/specs/DeepLink/TC-0018-navigate-via-deep-link/mobile.test.ts +28 -28
- package/templates/default/specs/DeepLink/TC-0018-navigate-via-deep-link/spec.md +29 -29
- package/templates/default/specs/DeepLink/suite.md +9 -9
- package/templates/default/specs/ElementMatchers/TC-0003-visibility-and-dom/mobile.test.ts +11 -11
- package/templates/default/specs/ElementMatchers/TC-0003-visibility-and-dom/spec.md +17 -17
- package/templates/default/specs/ElementMatchers/TC-0003-visibility-and-dom/web.test.ts +11 -11
- package/templates/default/specs/ElementMatchers/TC-0004-states-and-attributes/mobile.test.ts +29 -29
- package/templates/default/specs/ElementMatchers/TC-0004-states-and-attributes/spec.md +19 -19
- package/templates/default/specs/ElementMatchers/TC-0004-states-and-attributes/web.test.ts +29 -29
- package/templates/default/specs/ElementMatchers/suite.md +10 -10
- package/templates/default/specs/EnvironmentConfig/TC-0019-read-custom-environment-variable/common.test.ts +5 -5
- package/templates/default/specs/EnvironmentConfig/TC-0019-read-custom-environment-variable/spec.md +16 -16
- package/templates/default/specs/EnvironmentConfig/suite.md +9 -9
- package/templates/default/specs/PermissionRationale/TC-0010-camera-permission-allow/mobile.test.ts +26 -26
- package/templates/default/specs/PermissionRationale/TC-0010-camera-permission-allow/spec.md +22 -22
- package/templates/default/specs/PermissionRationale/TC-0011-camera-permission-deny/mobile.test.ts +13 -13
- package/templates/default/specs/PermissionRationale/TC-0011-camera-permission-deny/spec.md +20 -20
- package/templates/default/specs/PermissionRationale/suite.md +9 -9
- package/templates/default/specs/Playground/TC-0001-form-controls/mobile.test.ts +6 -6
- package/templates/default/specs/Playground/TC-0001-form-controls/spec.md +18 -18
- package/templates/default/specs/Playground/TC-0001-form-controls/web.test.ts +6 -6
- package/templates/default/specs/Playground/TC-0002-toggle-elements/mobile.test.ts +6 -6
- package/templates/default/specs/Playground/TC-0002-toggle-elements/spec.md +18 -18
- package/templates/default/specs/Playground/TC-0002-toggle-elements/web.test.ts +6 -6
- package/templates/default/spectra.config.ts +52 -52
- package/templates/default/support/actions/fillCredentials/mobile.action.ts +4 -4
- package/templates/default/support/actions/fillCredentials/web.action.ts +4 -4
- package/templates/default/support/actions/seedSession/mobile.action.ts +9 -9
- package/templates/default/support/actions/seedSession/web.action.ts +13 -13
- package/templates/default/support/steps/togglePlaygroundStates/mobile.step.ts +5 -5
- package/templates/default/support/steps/togglePlaygroundStates/web.step.ts +5 -5
- package/templates/default/support/steps/verifyPlaygroundState/mobile.step.ts +6 -6
- package/templates/default/support/steps/verifyPlaygroundState/web.step.ts +6 -6
- package/templates/nx/.nx/workspace-data/{59842386-c7c4-44ca-b2c2-20e1700bd13d.db-shm → 70094CFD-E89B-57A1-9619-2FC5F4963C54.db-shm} +0 -0
- package/templates/nx/.nx/workspace-data/70094CFD-E89B-57A1-9619-2FC5F4963C54.db-wal +0 -0
- package/templates/nx/.nx/workspace-data/d/daemon.log +6269 -1577
- package/templates/nx/.nx/workspace-data/file-map.json +129 -129
- package/templates/nx/.nx/workspace-data/lockfile.hash +1 -1
- package/templates/nx/.nx/workspace-data/nx_files.nxt +0 -0
- package/templates/nx/.nx/workspace-data/parsed-lock-file.json +535 -535
- package/templates/nx/.nx/workspace-data/project-graph.json +589 -590
- package/templates/nx/CLAUDE.md +10 -10
- package/templates/nx/package.json +2 -2
- package/templates/nx/packages/matchers/e2e/project.json +2 -2
- package/templates/nx/packages/matchers/e2e/specs/ApiInterception/TC-0008-fetch-mocking/mobile.test.ts +27 -27
- package/templates/nx/packages/matchers/e2e/specs/ApiInterception/TC-0008-fetch-mocking/web.test.ts +27 -27
- package/templates/nx/packages/matchers/e2e/specs/ApiInterception/TC-0009-post-mocking/mobile.test.ts +24 -24
- package/templates/nx/packages/matchers/e2e/specs/ApiInterception/TC-0009-post-mocking/web.test.ts +24 -24
- package/templates/nx/packages/matchers/e2e/specs/BrowserContext/TC-0007-title-and-navigation/mobile.test.ts +3 -3
- package/templates/nx/packages/matchers/e2e/specs/BrowserContext/TC-0007-title-and-navigation/web.test.ts +19 -19
- package/templates/nx/packages/matchers/e2e/specs/ContentMatchers/TC-0005-text-and-values/mobile.test.ts +3 -3
- package/templates/nx/packages/matchers/e2e/specs/ContentMatchers/TC-0005-text-and-values/web.test.ts +17 -17
- package/templates/nx/packages/matchers/e2e/specs/ContentMatchers/TC-0006-collections-and-empty/mobile.test.ts +3 -3
- package/templates/nx/packages/matchers/e2e/specs/ContentMatchers/TC-0006-collections-and-empty/web.test.ts +11 -11
- package/templates/nx/packages/matchers/e2e/specs/ElementMatchers/TC-0003-visibility-and-dom/mobile.test.ts +3 -3
- package/templates/nx/packages/matchers/e2e/specs/ElementMatchers/TC-0003-visibility-and-dom/web.test.ts +11 -11
- package/templates/nx/packages/matchers/e2e/specs/ElementMatchers/TC-0004-states-and-attributes/mobile.test.ts +3 -3
- package/templates/nx/packages/matchers/e2e/specs/ElementMatchers/TC-0004-states-and-attributes/web.test.ts +29 -29
- package/templates/nx/packages/matchers/e2e/specs/EnvironmentConfig/TC-0019-read-custom-environment-variable/common.test.ts +5 -5
- package/templates/nx/packages/matchers/e2e/specs/EnvironmentConfig/TC-0019-read-custom-environment-variable/spec.md +16 -16
- package/templates/nx/packages/matchers/e2e/specs/EnvironmentConfig/suite.md +9 -9
- package/templates/nx/packages/playground/e2e/project.json +2 -2
- package/templates/nx/packages/playground/e2e/specs/Playground/TC-0001-form-controls/mobile.test.ts +3 -3
- package/templates/nx/packages/playground/e2e/specs/Playground/TC-0001-form-controls/web.test.ts +6 -6
- package/templates/nx/packages/playground/e2e/specs/Playground/TC-0002-toggle-elements/mobile.test.ts +3 -3
- package/templates/nx/packages/playground/e2e/specs/Playground/TC-0002-toggle-elements/web.test.ts +6 -6
- package/templates/nx/pnpm-lock.yaml +6663 -6663
- package/templates/nx/pnpm-workspace.yaml +9 -9
- package/templates/nx/shared/testing/page-objects/MatchersPage/mobile.ts +33 -33
- package/templates/nx/shared/testing/page-objects/MatchersPage/web.ts +91 -91
- package/templates/nx/shared/testing/page-objects/NavigationPage/mobile.ts +5 -5
- package/templates/nx/shared/testing/page-objects/NavigationPage/web.ts +8 -8
- package/templates/nx/shared/testing/page-objects/PlaygroundPage/mobile.ts +26 -26
- package/templates/nx/shared/testing/page-objects/PlaygroundPage/web.ts +31 -31
- package/templates/nx/shared/testing/project.json +18 -19
- package/templates/nx/shared/testing/support/actions/fillCredentials/mobile.action.ts +4 -4
- package/templates/nx/shared/testing/support/actions/fillCredentials/web.action.ts +4 -4
- package/templates/nx/shared/testing/support/steps/togglePlaygroundStates/mobile.step.ts +3 -3
- package/templates/nx/shared/testing/support/steps/togglePlaygroundStates/web.step.ts +5 -5
- package/templates/nx/shared/testing/support/steps/verifyPlaygroundState/mobile.step.ts +4 -4
- package/templates/nx/shared/testing/support/steps/verifyPlaygroundState/web.step.ts +6 -6
- package/templates/nx/spectra.config.ts +52 -52
- package/templates/react-component/.cursorrules +17 -17
- package/templates/react-component/.vscode/extensions.json +5 -5
- package/templates/react-component/CLAUDE.md +14 -14
- package/templates/react-component/README.md +69 -69
- package/templates/react-component/fixtures/component-mock.json +12 -12
- package/templates/react-component/global-hooks/after/web.hook.ts +3 -3
- package/templates/react-component/global-hooks/before/web.hook.ts +3 -3
- package/templates/react-component/package.json +27 -27
- package/templates/react-component/page-objects/BadgeComponent/web.ts +23 -23
- package/templates/react-component/page-objects/ButtonComponent/web.ts +23 -23
- package/templates/react-component/page-objects/InputComponent/web.ts +13 -13
- package/templates/react-component/specs/BadgeComponent/TC-0002-badge-severities-and-dot/spec.md +18 -18
- package/templates/react-component/specs/BadgeComponent/TC-0002-badge-severities-and-dot/web.test.tsx +11 -11
- package/templates/react-component/specs/BadgeComponent/TC-0006-badge-success-with-dot/spec.md +18 -18
- package/templates/react-component/specs/BadgeComponent/TC-0006-badge-success-with-dot/web.test.tsx +10 -10
- package/templates/react-component/specs/BadgeComponent/TC-0007-badge-by-severity-lookup/spec.md +18 -18
- package/templates/react-component/specs/BadgeComponent/TC-0007-badge-by-severity-lookup/web.test.tsx +16 -16
- package/templates/react-component/specs/BadgeComponent/suite.md +12 -12
- package/templates/react-component/specs/ButtonComponent/TC-0001-button-rendering-and-click/spec.md +19 -19
- package/templates/react-component/specs/ButtonComponent/TC-0001-button-rendering-and-click/web.test.tsx +28 -28
- package/templates/react-component/specs/ButtonComponent/TC-0004-disabled-button-not-clickable/spec.md +19 -19
- package/templates/react-component/specs/ButtonComponent/TC-0004-disabled-button-not-clickable/web.test.tsx +22 -22
- package/templates/react-component/specs/ButtonComponent/TC-0005-button-renders-icon/spec.md +18 -18
- package/templates/react-component/specs/ButtonComponent/TC-0005-button-renders-icon/web.test.tsx +8 -8
- package/templates/react-component/specs/ButtonComponent/suite.md +12 -12
- package/templates/react-component/specs/InputComponent/TC-0003-input-typing-and-clear/spec.md +20 -20
- package/templates/react-component/specs/InputComponent/TC-0003-input-typing-and-clear/web.test.tsx +28 -28
- package/templates/react-component/specs/InputComponent/TC-0008-disabled-input-not-editable/spec.md +18 -18
- package/templates/react-component/specs/InputComponent/TC-0008-disabled-input-not-editable/web.test.tsx +9 -9
- package/templates/react-component/specs/InputComponent/suite.md +12 -12
- package/templates/react-component/spectra.config.ts +27 -27
- package/templates/react-component/src/components/Badge/Badge.tsx +60 -60
- package/templates/react-component/src/components/Button/Button.tsx +57 -57
- package/templates/react-component/src/components/Input/Input.tsx +41 -41
- package/templates/react-component/src/test-utils.tsx +23 -23
- package/templates/react-component/support/actions/fillInputField/web.action.ts +9 -9
- package/templates/react-component/support/steps/verifyButtonState/web.step.ts +12 -12
- package/bin/.testspectra-runner.hash +0 -1
- package/bin/testspectra-runner.exe +0 -0
- package/templates/nx/.nx/workspace-data/59842386-c7c4-44ca-b2c2-20e1700bd13d.db-wal +0 -0
- package/templates/nx/.nx/workspace-data/d/server-process.json +0 -3
- /package/templates/nx/.nx/workspace-data/{59842386-c7c4-44ca-b2c2-20e1700bd13d.db → 70094CFD-E89B-57A1-9619-2FC5F4963C54.db} +0 -0
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
---
|
|
2
|
-
id: badge-component-suite
|
|
3
|
-
name: Badge Component Suite
|
|
4
|
-
executionOrder: 2
|
|
5
|
-
tags:
|
|
6
|
-
- component
|
|
7
|
-
- badge
|
|
8
|
-
- status
|
|
9
|
-
---
|
|
10
|
-
|
|
11
|
-
# Badge Component Testing Suite
|
|
12
|
-
Verification of badge labels, severity color variants, and dot indicators.
|
|
1
|
+
---
|
|
2
|
+
id: badge-component-suite
|
|
3
|
+
name: Badge Component Suite
|
|
4
|
+
executionOrder: 2
|
|
5
|
+
tags:
|
|
6
|
+
- component
|
|
7
|
+
- badge
|
|
8
|
+
- status
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
# Badge Component Testing Suite
|
|
12
|
+
Verification of badge labels, severity color variants, and dot indicators.
|
package/templates/react-component/specs/ButtonComponent/TC-0001-button-rendering-and-click/spec.md
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
---
|
|
2
|
-
id: TC-0001
|
|
3
|
-
title: Verify button render, text, and click with Spectra DSL
|
|
4
|
-
priority: Critical
|
|
5
|
-
caseType: Positive
|
|
6
|
-
status: automated
|
|
7
|
-
coverage:
|
|
8
|
-
web: automated
|
|
9
|
-
---
|
|
10
|
-
|
|
11
|
-
# TC-0001: Button Rendering and Click Interaction
|
|
12
|
-
|
|
13
|
-
Verify that the `<Button />` component renders with the requested label and variant, and fires its `onClick` callback when clicked.
|
|
14
|
-
|
|
15
|
-
## Test Steps
|
|
16
|
-
|
|
17
|
-
1. Mount `<Button label="Save Changes" variant="primary" />`.
|
|
18
|
-
2. Verify the button is visible with the correct label and `data-variant` attribute.
|
|
19
|
-
3. Click the button and verify the `onClick` callback fires.
|
|
1
|
+
---
|
|
2
|
+
id: TC-0001
|
|
3
|
+
title: Verify button render, text, and click with Spectra DSL
|
|
4
|
+
priority: Critical
|
|
5
|
+
caseType: Positive
|
|
6
|
+
status: automated
|
|
7
|
+
coverage:
|
|
8
|
+
web: automated
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
# TC-0001: Button Rendering and Click Interaction
|
|
12
|
+
|
|
13
|
+
Verify that the `<Button />` component renders with the requested label and variant, and fires its `onClick` callback when clicked.
|
|
14
|
+
|
|
15
|
+
## Test Steps
|
|
16
|
+
|
|
17
|
+
1. Mount `<Button label="Save Changes" variant="primary" />`.
|
|
18
|
+
2. Verify the button is visible with the correct label and `data-variant` attribute.
|
|
19
|
+
3. Click the button and verify the `onClick` callback fires.
|
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
import { Button } from '../../../src/components/Button/Button.js';
|
|
2
|
-
import { withProviders } from '../../../src/test-utils.js';
|
|
3
|
-
|
|
4
|
-
it('Verify button render, text, and click with Spectra DSL', async () => {
|
|
5
|
-
let isClicked = false;
|
|
6
|
-
|
|
7
|
-
// Spectra.mount() renders into the shared root — no explicit cleanup between mounts needed.
|
|
8
|
-
await Spectra.mount(
|
|
9
|
-
withProviders(
|
|
10
|
-
<Button
|
|
11
|
-
label="Save Changes"
|
|
12
|
-
variant="primary"
|
|
13
|
-
onClick={() => {
|
|
14
|
-
isClicked = true;
|
|
15
|
-
}}
|
|
16
|
-
/>,
|
|
17
|
-
),
|
|
18
|
-
);
|
|
19
|
-
|
|
20
|
-
// TestSpectra Ambient Component Object (ButtonComponent)
|
|
21
|
-
await ButtonComponent.root.shouldBeVisible();
|
|
22
|
-
await ButtonComponent.root.shouldHaveText('Save Changes');
|
|
23
|
-
await ButtonComponent.root.shouldHaveAttribute('data-variant', 'primary');
|
|
24
|
-
await ButtonComponent.root.click();
|
|
25
|
-
|
|
26
|
-
// Verify callback state
|
|
27
|
-
expect(isClicked).toBe(true);
|
|
28
|
-
});
|
|
1
|
+
import { Button } from '../../../src/components/Button/Button.js';
|
|
2
|
+
import { withProviders } from '../../../src/test-utils.js';
|
|
3
|
+
|
|
4
|
+
it('Verify button render, text, and click with Spectra DSL', async () => {
|
|
5
|
+
let isClicked = false;
|
|
6
|
+
|
|
7
|
+
// Spectra.mount() renders into the shared root — no explicit cleanup between mounts needed.
|
|
8
|
+
await Spectra.mount(
|
|
9
|
+
withProviders(
|
|
10
|
+
<Button
|
|
11
|
+
label="Save Changes"
|
|
12
|
+
variant="primary"
|
|
13
|
+
onClick={() => {
|
|
14
|
+
isClicked = true;
|
|
15
|
+
}}
|
|
16
|
+
/>,
|
|
17
|
+
),
|
|
18
|
+
);
|
|
19
|
+
|
|
20
|
+
// TestSpectra Ambient Component Object (ButtonComponent)
|
|
21
|
+
await ButtonComponent.root.shouldBeVisible();
|
|
22
|
+
await ButtonComponent.root.shouldHaveText('Save Changes');
|
|
23
|
+
await ButtonComponent.root.shouldHaveAttribute('data-variant', 'primary');
|
|
24
|
+
await ButtonComponent.root.click();
|
|
25
|
+
|
|
26
|
+
// Verify callback state
|
|
27
|
+
expect(isClicked).toBe(true);
|
|
28
|
+
});
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
---
|
|
2
|
-
id: TC-0004
|
|
3
|
-
title: Verify disabled button cannot be clicked
|
|
4
|
-
priority: High
|
|
5
|
-
caseType: Negative
|
|
6
|
-
status: automated
|
|
7
|
-
coverage:
|
|
8
|
-
web: automated
|
|
9
|
-
---
|
|
10
|
-
|
|
11
|
-
# TC-0004: Disabled Button Interaction
|
|
12
|
-
|
|
13
|
-
Verify that a disabled `<Button />` renders in a disabled state and its `onClick` callback does not fire when clicked.
|
|
14
|
-
|
|
15
|
-
## Test Steps
|
|
16
|
-
|
|
17
|
-
1. Mount `<Button label="Disabled Action" disabled />`.
|
|
18
|
-
2. Verify the button is visible and disabled.
|
|
19
|
-
3. Attempt to click the button and verify the `onClick` callback does not fire.
|
|
1
|
+
---
|
|
2
|
+
id: TC-0004
|
|
3
|
+
title: Verify disabled button cannot be clicked
|
|
4
|
+
priority: High
|
|
5
|
+
caseType: Negative
|
|
6
|
+
status: automated
|
|
7
|
+
coverage:
|
|
8
|
+
web: automated
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
# TC-0004: Disabled Button Interaction
|
|
12
|
+
|
|
13
|
+
Verify that a disabled `<Button />` renders in a disabled state and its `onClick` callback does not fire when clicked.
|
|
14
|
+
|
|
15
|
+
## Test Steps
|
|
16
|
+
|
|
17
|
+
1. Mount `<Button label="Disabled Action" disabled />`.
|
|
18
|
+
2. Verify the button is visible and disabled.
|
|
19
|
+
3. Attempt to click the button and verify the `onClick` callback does not fire.
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import { Button } from '../../../src/components/Button/Button.js';
|
|
2
|
-
|
|
3
|
-
it('Verify disabled button cannot be clicked', async () => {
|
|
4
|
-
let isClicked = false;
|
|
5
|
-
|
|
6
|
-
await Spectra.mount(
|
|
7
|
-
<Button
|
|
8
|
-
label="Disabled Action"
|
|
9
|
-
disabled
|
|
10
|
-
onClick={() => {
|
|
11
|
-
isClicked = true;
|
|
12
|
-
}}
|
|
13
|
-
/>,
|
|
14
|
-
);
|
|
15
|
-
|
|
16
|
-
await ButtonComponent.root.shouldBeVisible();
|
|
17
|
-
await ButtonComponent.root.shouldBeDisabled();
|
|
18
|
-
|
|
19
|
-
// Attempt click - should not fire callback
|
|
20
|
-
await ButtonComponent.root.click().catch(() => {});
|
|
21
|
-
expect(isClicked).toBe(false);
|
|
22
|
-
});
|
|
1
|
+
import { Button } from '../../../src/components/Button/Button.js';
|
|
2
|
+
|
|
3
|
+
it('Verify disabled button cannot be clicked', async () => {
|
|
4
|
+
let isClicked = false;
|
|
5
|
+
|
|
6
|
+
await Spectra.mount(
|
|
7
|
+
<Button
|
|
8
|
+
label="Disabled Action"
|
|
9
|
+
disabled
|
|
10
|
+
onClick={() => {
|
|
11
|
+
isClicked = true;
|
|
12
|
+
}}
|
|
13
|
+
/>,
|
|
14
|
+
);
|
|
15
|
+
|
|
16
|
+
await ButtonComponent.root.shouldBeVisible();
|
|
17
|
+
await ButtonComponent.root.shouldBeDisabled();
|
|
18
|
+
|
|
19
|
+
// Attempt click - should not fire callback
|
|
20
|
+
await ButtonComponent.root.click().catch(() => {});
|
|
21
|
+
expect(isClicked).toBe(false);
|
|
22
|
+
});
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
---
|
|
2
|
-
id: TC-0005
|
|
3
|
-
title: Verify button renders optional icon
|
|
4
|
-
priority: Medium
|
|
5
|
-
caseType: Positive
|
|
6
|
-
status: automated
|
|
7
|
-
coverage:
|
|
8
|
-
web: automated
|
|
9
|
-
---
|
|
10
|
-
|
|
11
|
-
# TC-0005: Button Optional Icon Rendering
|
|
12
|
-
|
|
13
|
-
Verify that `<Button />` renders an optional leading icon when the `icon` prop is provided.
|
|
14
|
-
|
|
15
|
-
## Test Steps
|
|
16
|
-
|
|
17
|
-
1. Mount `<Button label="Download Report" icon={...} />` with an icon element.
|
|
18
|
-
2. Verify the icon is visible and renders the expected content.
|
|
1
|
+
---
|
|
2
|
+
id: TC-0005
|
|
3
|
+
title: Verify button renders optional icon
|
|
4
|
+
priority: Medium
|
|
5
|
+
caseType: Positive
|
|
6
|
+
status: automated
|
|
7
|
+
coverage:
|
|
8
|
+
web: automated
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
# TC-0005: Button Optional Icon Rendering
|
|
12
|
+
|
|
13
|
+
Verify that `<Button />` renders an optional leading icon when the `icon` prop is provided.
|
|
14
|
+
|
|
15
|
+
## Test Steps
|
|
16
|
+
|
|
17
|
+
1. Mount `<Button label="Download Report" icon={...} />` with an icon element.
|
|
18
|
+
2. Verify the icon is visible and renders the expected content.
|
package/templates/react-component/specs/ButtonComponent/TC-0005-button-renders-icon/web.test.tsx
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { Button } from '../../../src/components/Button/Button.js';
|
|
2
|
-
|
|
3
|
-
it('Verify button renders optional icon', async () => {
|
|
4
|
-
await Spectra.mount(<Button label="Download Report" icon={<span data-testid="button-icon">📥</span>} />);
|
|
5
|
-
|
|
6
|
-
await ButtonComponent.icon.shouldBeVisible();
|
|
7
|
-
await ButtonComponent.icon.shouldHaveText('📥');
|
|
8
|
-
});
|
|
1
|
+
import { Button } from '../../../src/components/Button/Button.js';
|
|
2
|
+
|
|
3
|
+
it('Verify button renders optional icon', async () => {
|
|
4
|
+
await Spectra.mount(<Button label="Download Report" icon={<span data-testid="button-icon">📥</span>} />);
|
|
5
|
+
|
|
6
|
+
await ButtonComponent.icon.shouldBeVisible();
|
|
7
|
+
await ButtonComponent.icon.shouldHaveText('📥');
|
|
8
|
+
});
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
---
|
|
2
|
-
id: button-component-suite
|
|
3
|
-
name: Button Component Suite
|
|
4
|
-
executionOrder: 1
|
|
5
|
-
tags:
|
|
6
|
-
- component
|
|
7
|
-
- button
|
|
8
|
-
- atoms
|
|
9
|
-
---
|
|
10
|
-
|
|
11
|
-
# Button Component Testing Suite
|
|
12
|
-
Verification of isolated button props, event listeners, accessibility, and visual variants.
|
|
1
|
+
---
|
|
2
|
+
id: button-component-suite
|
|
3
|
+
name: Button Component Suite
|
|
4
|
+
executionOrder: 1
|
|
5
|
+
tags:
|
|
6
|
+
- component
|
|
7
|
+
- button
|
|
8
|
+
- atoms
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
# Button Component Testing Suite
|
|
12
|
+
Verification of isolated button props, event listeners, accessibility, and visual variants.
|
package/templates/react-component/specs/InputComponent/TC-0003-input-typing-and-clear/spec.md
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
---
|
|
2
|
-
id: TC-0003
|
|
3
|
-
title: Verify input placeholder and typing interaction
|
|
4
|
-
priority: Critical
|
|
5
|
-
caseType: Positive
|
|
6
|
-
status: automated
|
|
7
|
-
coverage:
|
|
8
|
-
web: automated
|
|
9
|
-
---
|
|
10
|
-
|
|
11
|
-
# TC-0003: Input Typing and Placeholder
|
|
12
|
-
|
|
13
|
-
Verify that `<Input />` renders its placeholder, accepts typed text, and fires `onChange` with the typed value.
|
|
14
|
-
|
|
15
|
-
## Test Steps
|
|
16
|
-
|
|
17
|
-
1. Mount `<Input placeholder="Enter email address" />` with an `onChange` handler.
|
|
18
|
-
2. Verify the input is visible and the placeholder is discoverable.
|
|
19
|
-
3. Type `test@example.com` into the input and verify the value updates.
|
|
20
|
-
4. Verify the `onChange` handler received the typed value.
|
|
1
|
+
---
|
|
2
|
+
id: TC-0003
|
|
3
|
+
title: Verify input placeholder and typing interaction
|
|
4
|
+
priority: Critical
|
|
5
|
+
caseType: Positive
|
|
6
|
+
status: automated
|
|
7
|
+
coverage:
|
|
8
|
+
web: automated
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
# TC-0003: Input Typing and Placeholder
|
|
12
|
+
|
|
13
|
+
Verify that `<Input />` renders its placeholder, accepts typed text, and fires `onChange` with the typed value.
|
|
14
|
+
|
|
15
|
+
## Test Steps
|
|
16
|
+
|
|
17
|
+
1. Mount `<Input placeholder="Enter email address" />` with an `onChange` handler.
|
|
18
|
+
2. Verify the input is visible and the placeholder is discoverable.
|
|
19
|
+
3. Type `test@example.com` into the input and verify the value updates.
|
|
20
|
+
4. Verify the `onChange` handler received the typed value.
|
package/templates/react-component/specs/InputComponent/TC-0003-input-typing-and-clear/web.test.tsx
CHANGED
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
import { Input } from '../../../src/components/Input/Input.js';
|
|
2
|
-
import { withProviders } from '../../../src/test-utils.js';
|
|
3
|
-
|
|
4
|
-
it('Verify input placeholder and typing interaction', async () => {
|
|
5
|
-
let currentVal = '';
|
|
6
|
-
|
|
7
|
-
await Spectra.mount(
|
|
8
|
-
withProviders(
|
|
9
|
-
<Input
|
|
10
|
-
placeholder="Enter email address"
|
|
11
|
-
onChange={(e) => {
|
|
12
|
-
currentVal = e.target.value;
|
|
13
|
-
}}
|
|
14
|
-
/>,
|
|
15
|
-
),
|
|
16
|
-
);
|
|
17
|
-
|
|
18
|
-
// 1. Assert element is visible via InputComponent
|
|
19
|
-
await InputComponent.root.shouldBeVisible();
|
|
20
|
-
await InputComponent.byPlaceholder('email address').shouldBeVisible();
|
|
21
|
-
|
|
22
|
-
// 2. Type text using Spectra DSL
|
|
23
|
-
await InputComponent.root.type('test@example.com');
|
|
24
|
-
await InputComponent.root.shouldHaveValue('test@example.com');
|
|
25
|
-
|
|
26
|
-
// 3. Verify onChange state
|
|
27
|
-
expect(currentVal).toBe('test@example.com');
|
|
28
|
-
});
|
|
1
|
+
import { Input } from '../../../src/components/Input/Input.js';
|
|
2
|
+
import { withProviders } from '../../../src/test-utils.js';
|
|
3
|
+
|
|
4
|
+
it('Verify input placeholder and typing interaction', async () => {
|
|
5
|
+
let currentVal = '';
|
|
6
|
+
|
|
7
|
+
await Spectra.mount(
|
|
8
|
+
withProviders(
|
|
9
|
+
<Input
|
|
10
|
+
placeholder="Enter email address"
|
|
11
|
+
onChange={(e) => {
|
|
12
|
+
currentVal = e.target.value;
|
|
13
|
+
}}
|
|
14
|
+
/>,
|
|
15
|
+
),
|
|
16
|
+
);
|
|
17
|
+
|
|
18
|
+
// 1. Assert element is visible via InputComponent
|
|
19
|
+
await InputComponent.root.shouldBeVisible();
|
|
20
|
+
await InputComponent.byPlaceholder('email address').shouldBeVisible();
|
|
21
|
+
|
|
22
|
+
// 2. Type text using Spectra DSL
|
|
23
|
+
await InputComponent.root.type('test@example.com');
|
|
24
|
+
await InputComponent.root.shouldHaveValue('test@example.com');
|
|
25
|
+
|
|
26
|
+
// 3. Verify onChange state
|
|
27
|
+
expect(currentVal).toBe('test@example.com');
|
|
28
|
+
});
|
package/templates/react-component/specs/InputComponent/TC-0008-disabled-input-not-editable/spec.md
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
---
|
|
2
|
-
id: TC-0008
|
|
3
|
-
title: Verify disabled input cannot be typed into
|
|
4
|
-
priority: High
|
|
5
|
-
caseType: Negative
|
|
6
|
-
status: automated
|
|
7
|
-
coverage:
|
|
8
|
-
web: automated
|
|
9
|
-
---
|
|
10
|
-
|
|
11
|
-
# TC-0008: Disabled Input State
|
|
12
|
-
|
|
13
|
-
Verify that a disabled `<Input />` renders in a disabled state.
|
|
14
|
-
|
|
15
|
-
## Test Steps
|
|
16
|
-
|
|
17
|
-
1. Mount `<Input disabled placeholder="Disabled field" />`.
|
|
18
|
-
2. Verify the input is visible and disabled.
|
|
1
|
+
---
|
|
2
|
+
id: TC-0008
|
|
3
|
+
title: Verify disabled input cannot be typed into
|
|
4
|
+
priority: High
|
|
5
|
+
caseType: Negative
|
|
6
|
+
status: automated
|
|
7
|
+
coverage:
|
|
8
|
+
web: automated
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
# TC-0008: Disabled Input State
|
|
12
|
+
|
|
13
|
+
Verify that a disabled `<Input />` renders in a disabled state.
|
|
14
|
+
|
|
15
|
+
## Test Steps
|
|
16
|
+
|
|
17
|
+
1. Mount `<Input disabled placeholder="Disabled field" />`.
|
|
18
|
+
2. Verify the input is visible and disabled.
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { Input } from '../../../src/components/Input/Input.js';
|
|
2
|
-
import { withProviders } from '../../../src/test-utils.js';
|
|
3
|
-
|
|
4
|
-
it('Verify disabled input cannot be typed into', async () => {
|
|
5
|
-
await Spectra.mount(withProviders(<Input disabled placeholder="Disabled field" />));
|
|
6
|
-
|
|
7
|
-
await InputComponent.root.shouldBeVisible();
|
|
8
|
-
await InputComponent.root.shouldBeDisabled();
|
|
9
|
-
});
|
|
1
|
+
import { Input } from '../../../src/components/Input/Input.js';
|
|
2
|
+
import { withProviders } from '../../../src/test-utils.js';
|
|
3
|
+
|
|
4
|
+
it('Verify disabled input cannot be typed into', async () => {
|
|
5
|
+
await Spectra.mount(withProviders(<Input disabled placeholder="Disabled field" />));
|
|
6
|
+
|
|
7
|
+
await InputComponent.root.shouldBeVisible();
|
|
8
|
+
await InputComponent.root.shouldBeDisabled();
|
|
9
|
+
});
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
---
|
|
2
|
-
id: input-component-suite
|
|
3
|
-
name: Input Component Suite
|
|
4
|
-
executionOrder: 3
|
|
5
|
-
tags:
|
|
6
|
-
- component
|
|
7
|
-
- input
|
|
8
|
-
- forms
|
|
9
|
-
---
|
|
10
|
-
|
|
11
|
-
# Input Component Testing Suite
|
|
12
|
-
Verification of text inputs, placeholder labels, keyboard typing, and onChange events.
|
|
1
|
+
---
|
|
2
|
+
id: input-component-suite
|
|
3
|
+
name: Input Component Suite
|
|
4
|
+
executionOrder: 3
|
|
5
|
+
tags:
|
|
6
|
+
- component
|
|
7
|
+
- input
|
|
8
|
+
- forms
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
# Input Component Testing Suite
|
|
12
|
+
Verification of text inputs, placeholder labels, keyboard typing, and onChange events.
|
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import { defineConfig } from "@testspectra/cli";
|
|
2
|
-
|
|
3
|
-
export default defineConfig({
|
|
4
|
-
webConfig: {
|
|
5
|
-
baseUrl: "http://localhost:5173",
|
|
6
|
-
maxConcurrentSessions: "4",
|
|
7
|
-
headless: true,
|
|
8
|
-
implicitWait: "5000",
|
|
9
|
-
pageLoadTimeout: "30000",
|
|
10
|
-
scriptTimeout: "30000",
|
|
11
|
-
parallelizationMode: "testcase",
|
|
12
|
-
},
|
|
13
|
-
browsers: [
|
|
14
|
-
{
|
|
15
|
-
id: "chrome-desktop",
|
|
16
|
-
type: "chrome",
|
|
17
|
-
mobileEmulation: false,
|
|
18
|
-
},
|
|
19
|
-
],
|
|
20
|
-
executionConfig: {
|
|
21
|
-
networkMonitoringEnabled: true,
|
|
22
|
-
fastResponseTime: "200",
|
|
23
|
-
normalResponseTime: "1000",
|
|
24
|
-
monitoredDomains: [],
|
|
25
|
-
environmentVariables: [],
|
|
26
|
-
},
|
|
27
|
-
});
|
|
1
|
+
import { defineConfig } from "@testspectra/cli";
|
|
2
|
+
|
|
3
|
+
export default defineConfig({
|
|
4
|
+
webConfig: {
|
|
5
|
+
baseUrl: "http://localhost:5173",
|
|
6
|
+
maxConcurrentSessions: "4",
|
|
7
|
+
headless: true,
|
|
8
|
+
implicitWait: "5000",
|
|
9
|
+
pageLoadTimeout: "30000",
|
|
10
|
+
scriptTimeout: "30000",
|
|
11
|
+
parallelizationMode: "testcase",
|
|
12
|
+
},
|
|
13
|
+
browsers: [
|
|
14
|
+
{
|
|
15
|
+
id: "chrome-desktop",
|
|
16
|
+
type: "chrome",
|
|
17
|
+
mobileEmulation: false,
|
|
18
|
+
},
|
|
19
|
+
],
|
|
20
|
+
executionConfig: {
|
|
21
|
+
networkMonitoringEnabled: true,
|
|
22
|
+
fastResponseTime: "200",
|
|
23
|
+
normalResponseTime: "1000",
|
|
24
|
+
monitoredDomains: [],
|
|
25
|
+
environmentVariables: [],
|
|
26
|
+
},
|
|
27
|
+
});
|
|
@@ -1,60 +1,60 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
|
|
3
|
-
export interface BadgeProps {
|
|
4
|
-
label: string;
|
|
5
|
-
severity?: 'info' | 'success' | 'warning' | 'danger';
|
|
6
|
-
dot?: boolean;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
export const Badge: React.FC<BadgeProps> = ({
|
|
10
|
-
label,
|
|
11
|
-
severity = 'info',
|
|
12
|
-
dot = false,
|
|
13
|
-
}) => {
|
|
14
|
-
const getColors = () => {
|
|
15
|
-
switch (severity) {
|
|
16
|
-
case 'success':
|
|
17
|
-
return { bg: '#dcfce7', text: '#15803d' };
|
|
18
|
-
case 'warning':
|
|
19
|
-
return { bg: '#fef9c3', text: '#a16207' };
|
|
20
|
-
case 'danger':
|
|
21
|
-
return { bg: '#fee2e2', text: '#b91c1c' };
|
|
22
|
-
case 'info':
|
|
23
|
-
default:
|
|
24
|
-
return { bg: '#e0f2fe', text: '#0369a1' };
|
|
25
|
-
}
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
const { bg, text } = getColors();
|
|
29
|
-
|
|
30
|
-
return (
|
|
31
|
-
<span
|
|
32
|
-
data-testid="testspectra-badge"
|
|
33
|
-
data-severity={severity}
|
|
34
|
-
style={{
|
|
35
|
-
display: 'inline-flex',
|
|
36
|
-
alignItems: 'center',
|
|
37
|
-
gap: '6px',
|
|
38
|
-
padding: '2px 8px',
|
|
39
|
-
borderRadius: '9999px',
|
|
40
|
-
backgroundColor: bg,
|
|
41
|
-
color: text,
|
|
42
|
-
fontSize: '12px',
|
|
43
|
-
fontWeight: 600,
|
|
44
|
-
}}
|
|
45
|
-
>
|
|
46
|
-
{dot && (
|
|
47
|
-
<span
|
|
48
|
-
data-testid="badge-dot"
|
|
49
|
-
style={{
|
|
50
|
-
width: '6px',
|
|
51
|
-
height: '6px',
|
|
52
|
-
borderRadius: '50%',
|
|
53
|
-
backgroundColor: text,
|
|
54
|
-
}}
|
|
55
|
-
/>
|
|
56
|
-
)}
|
|
57
|
-
<span data-testid="badge-label">{label}</span>
|
|
58
|
-
</span>
|
|
59
|
-
);
|
|
60
|
-
};
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
export interface BadgeProps {
|
|
4
|
+
label: string;
|
|
5
|
+
severity?: 'info' | 'success' | 'warning' | 'danger';
|
|
6
|
+
dot?: boolean;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export const Badge: React.FC<BadgeProps> = ({
|
|
10
|
+
label,
|
|
11
|
+
severity = 'info',
|
|
12
|
+
dot = false,
|
|
13
|
+
}) => {
|
|
14
|
+
const getColors = () => {
|
|
15
|
+
switch (severity) {
|
|
16
|
+
case 'success':
|
|
17
|
+
return { bg: '#dcfce7', text: '#15803d' };
|
|
18
|
+
case 'warning':
|
|
19
|
+
return { bg: '#fef9c3', text: '#a16207' };
|
|
20
|
+
case 'danger':
|
|
21
|
+
return { bg: '#fee2e2', text: '#b91c1c' };
|
|
22
|
+
case 'info':
|
|
23
|
+
default:
|
|
24
|
+
return { bg: '#e0f2fe', text: '#0369a1' };
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
const { bg, text } = getColors();
|
|
29
|
+
|
|
30
|
+
return (
|
|
31
|
+
<span
|
|
32
|
+
data-testid="testspectra-badge"
|
|
33
|
+
data-severity={severity}
|
|
34
|
+
style={{
|
|
35
|
+
display: 'inline-flex',
|
|
36
|
+
alignItems: 'center',
|
|
37
|
+
gap: '6px',
|
|
38
|
+
padding: '2px 8px',
|
|
39
|
+
borderRadius: '9999px',
|
|
40
|
+
backgroundColor: bg,
|
|
41
|
+
color: text,
|
|
42
|
+
fontSize: '12px',
|
|
43
|
+
fontWeight: 600,
|
|
44
|
+
}}
|
|
45
|
+
>
|
|
46
|
+
{dot && (
|
|
47
|
+
<span
|
|
48
|
+
data-testid="badge-dot"
|
|
49
|
+
style={{
|
|
50
|
+
width: '6px',
|
|
51
|
+
height: '6px',
|
|
52
|
+
borderRadius: '50%',
|
|
53
|
+
backgroundColor: text,
|
|
54
|
+
}}
|
|
55
|
+
/>
|
|
56
|
+
)}
|
|
57
|
+
<span data-testid="badge-label">{label}</span>
|
|
58
|
+
</span>
|
|
59
|
+
);
|
|
60
|
+
};
|