ux4g-components-web 1.4.0 → 1.5.0
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 +76 -0
- package/dist/__tests__/css-bundle.integration.test.d.ts +11 -0
- package/dist/__tests__/css-bundle.integration.test.js +1102 -0
- package/dist/__tests__/css-bundle.phase10.property.test.d.ts +9 -0
- package/dist/__tests__/css-bundle.phase10.property.test.js +64 -0
- package/dist/__tests__/css-bundle.phase5.property.test.d.ts +9 -0
- package/dist/__tests__/css-bundle.phase5.property.test.js +126 -0
- package/dist/__tests__/css-bundle.phase6.property.test.d.ts +9 -0
- package/dist/__tests__/css-bundle.phase6.property.test.js +73 -0
- package/dist/__tests__/css-bundle.phase7.property.test.d.ts +9 -0
- package/dist/__tests__/css-bundle.phase7.property.test.js +76 -0
- package/dist/__tests__/css-bundle.phase8.property.test.d.ts +9 -0
- package/dist/__tests__/css-bundle.phase8.property.test.js +67 -0
- package/dist/__tests__/css-bundle.phase9.property.test.d.ts +9 -0
- package/dist/__tests__/css-bundle.phase9.property.test.js +93 -0
- package/dist/__tests__/css-bundle.property.test.d.ts +14 -0
- package/dist/__tests__/css-bundle.property.test.js +393 -0
- package/dist/__tests__/dom-generators.determinism.property.test.d.ts +1 -0
- package/dist/__tests__/dom-generators.determinism.property.test.js +71 -0
- package/dist/__tests__/dom-generators.id.property.test.d.ts +1 -0
- package/dist/__tests__/dom-generators.id.property.test.js +99 -0
- package/dist/__tests__/dom-generators.otp.property.test.d.ts +1 -0
- package/dist/__tests__/dom-generators.property.test.d.ts +1 -0
- package/dist/__tests__/dom-generators.property.test.js +205 -0
- package/dist/__tests__/dom-generators.states.property.test.d.ts +1 -0
- package/dist/__tests__/dom-generators.table.property.test.d.ts +1 -0
- package/dist/__tests__/dom-generators.tier1.property.test.d.ts +1 -0
- package/dist/__tests__/dom-generators.tier1.property.test.js +403 -0
- package/dist/__tests__/dom-generators.validation.property.test.d.ts +1 -0
- package/dist/__tests__/dom-generators.validation.property.test.js +327 -0
- package/dist/__tests__/megamenu.classbuilder.property.test.d.ts +1 -0
- package/dist/__tests__/megamenu.classbuilder.property.test.js +88 -0
- package/dist/__tests__/smoke.test.d.ts +1 -0
- package/dist/__tests__/smoke.test.js +65 -0
- package/dist/__tests__/types.phase10.property.test.d.ts +1 -0
- package/dist/__tests__/types.phase10.property.test.js +166 -0
- package/dist/__tests__/types.phase10.test.d.ts +1 -0
- package/dist/__tests__/types.phase10.test.js +76 -0
- package/dist/__tests__/types.phase3.property.test.d.ts +1 -0
- package/dist/__tests__/types.phase3.property.test.js +83 -0
- package/dist/__tests__/types.phase3.test.d.ts +1 -0
- package/dist/__tests__/types.phase3.test.js +76 -0
- package/dist/__tests__/types.phase4.property.test.d.ts +1 -0
- package/dist/__tests__/types.phase4.property.test.js +119 -0
- package/dist/__tests__/types.phase4.test.d.ts +1 -0
- package/dist/__tests__/types.phase4.test.js +70 -0
- package/dist/__tests__/types.phase5.property.test.d.ts +1 -0
- package/dist/__tests__/types.phase5.property.test.js +120 -0
- package/dist/__tests__/types.phase5.test.d.ts +1 -0
- package/dist/__tests__/types.phase5.test.js +64 -0
- package/dist/__tests__/types.phase6.property.test.d.ts +1 -0
- package/dist/__tests__/types.phase6.property.test.js +189 -0
- package/dist/__tests__/types.phase6.test.d.ts +1 -0
- package/dist/__tests__/types.phase6.test.js +121 -0
- package/dist/__tests__/types.phase7.property.test.d.ts +1 -0
- package/dist/__tests__/types.phase7.property.test.js +217 -0
- package/dist/__tests__/types.phase7.test.d.ts +1 -0
- package/dist/__tests__/types.phase7.test.js +106 -0
- package/dist/__tests__/types.phase8.property.test.d.ts +1 -0
- package/dist/__tests__/types.phase8.property.test.js +224 -0
- package/dist/__tests__/types.phase8.test.d.ts +1 -0
- package/dist/__tests__/types.phase8.test.js +114 -0
- package/dist/__tests__/types.phase9.property.test.d.ts +1 -0
- package/dist/__tests__/types.phase9.property.test.js +347 -0
- package/dist/__tests__/types.phase9.test.d.ts +1 -0
- package/dist/__tests__/types.phase9.test.js +226 -0
- package/dist/__tests__/types.restructure.property.test.d.ts +1 -0
- package/dist/__tests__/types.restructure.property.test.js +76 -0
- package/dist/__tests__/types.test.d.ts +1 -0
- package/dist/__tests__/types.test.js +175 -0
- package/dist/dom-generators/accordion.d.ts +23 -0
- package/dist/dom-generators/avatar.d.ts +19 -0
- package/dist/dom-generators/carousel.d.ts +20 -0
- package/dist/dom-generators/chip.d.ts +18 -0
- package/dist/dom-generators/combobox.d.ts +28 -0
- package/dist/dom-generators/date-picker.d.ts +19 -0
- package/dist/dom-generators/dom-generators/accordion.d.ts +21 -0
- package/dist/dom-generators/dom-generators/avatar.d.ts +17 -0
- package/dist/dom-generators/dom-generators/carousel.d.ts +19 -0
- package/dist/dom-generators/dom-generators/chip.d.ts +16 -0
- package/dist/dom-generators/dom-generators/combobox.d.ts +26 -0
- package/dist/dom-generators/dom-generators/date-picker.d.ts +18 -0
- package/dist/dom-generators/dom-generators/drawer.d.ts +17 -0
- package/dist/dom-generators/dom-generators/dropdown.d.ts +26 -0
- package/dist/dom-generators/dom-generators/file-upload.d.ts +20 -0
- package/dist/dom-generators/dom-generators/id-generator.d.ts +9 -0
- package/dist/dom-generators/dom-generators/index.d.ts +27 -0
- package/dist/dom-generators/dom-generators/modal.d.ts +19 -0
- package/dist/dom-generators/dom-generators/otp.d.ts +16 -0
- package/dist/dom-generators/dom-generators/popover.d.ts +17 -0
- package/dist/dom-generators/dom-generators/progress.d.ts +16 -0
- package/dist/dom-generators/dom-generators/search.d.ts +20 -0
- package/dist/dom-generators/dom-generators/stepper.d.ts +21 -0
- package/dist/dom-generators/dom-generators/table.d.ts +23 -0
- package/dist/dom-generators/dom-generators/tabs.d.ts +21 -0
- package/dist/dom-generators/dom-generators/time-picker.d.ts +18 -0
- package/dist/dom-generators/dom-generators/tooltip.d.ts +17 -0
- package/dist/dom-generators/dom-generators/types.d.ts +27 -0
- package/dist/dom-generators/dom-generators/validate.d.ts +20 -0
- package/dist/dom-generators/drawer.d.ts +19 -0
- package/dist/dom-generators/dropdown.d.ts +28 -0
- package/dist/dom-generators/file-upload.d.ts +22 -0
- package/dist/dom-generators/id-generator.d.ts +9 -0
- package/dist/dom-generators/index.bundled.d.ts +654 -0
- package/dist/dom-generators/index.cjs +2029 -0
- package/dist/dom-generators/index.d.ts +27 -0
- package/dist/dom-generators/index.mjs +2001 -0
- package/dist/dom-generators/modal.d.ts +21 -0
- package/dist/dom-generators/otp.d.ts +18 -0
- package/dist/dom-generators/popover.d.ts +19 -0
- package/dist/dom-generators/progress.d.ts +18 -0
- package/dist/dom-generators/search.d.ts +22 -0
- package/dist/dom-generators/stepper.d.ts +23 -0
- package/dist/dom-generators/table.d.ts +25 -0
- package/dist/dom-generators/tabs.d.ts +23 -0
- package/dist/dom-generators/time-picker.d.ts +19 -0
- package/dist/dom-generators/tooltip.d.ts +19 -0
- package/dist/dom-generators/types.d.ts +155 -0
- package/dist/dom-generators/validate.d.ts +20 -0
- package/dist/runtime/bootstrap.js +59 -0
- package/dist/runtime/index.js +55 -0
- package/dist/types.d.ts +155 -0
- package/dist/types.js +552 -0
- package/package.json +12 -2
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
// src/__tests__/types.phase10.test.ts
|
|
2
|
+
// Unit tests for all Phase 10 build functions
|
|
3
|
+
// Requirements: 6.10, 6.11, 6.12, 6.13, 6.14, 6.15, 6.16, 6.17, 6.18, 6.19
|
|
4
|
+
import { buildSlotGridClasses, buildFooterClasses, buildResultListRowClasses, } from '../../src/types';
|
|
5
|
+
// ── SlotGrid ──────────────────────────────────────────────────────────────────
|
|
6
|
+
describe('buildSlotGridClasses', () => {
|
|
7
|
+
it("no args -> 'ux4g-time-slot-weekly-container'", () => {
|
|
8
|
+
expect(buildSlotGridClasses()).toBe('ux4g-time-slot-weekly-container');
|
|
9
|
+
});
|
|
10
|
+
it("variant='weekly' -> 'ux4g-time-slot-weekly-container'", () => {
|
|
11
|
+
expect(buildSlotGridClasses('weekly')).toBe('ux4g-time-slot-weekly-container');
|
|
12
|
+
});
|
|
13
|
+
it("variant='compact' -> 'ux4g-time-slot-compact-container'", () => {
|
|
14
|
+
expect(buildSlotGridClasses('compact')).toBe('ux4g-time-slot-compact-container');
|
|
15
|
+
});
|
|
16
|
+
it("variant='weekly' with extra -> 'ux4g-time-slot-weekly-container my'", () => {
|
|
17
|
+
expect(buildSlotGridClasses('weekly', 'my')).toBe('ux4g-time-slot-weekly-container my');
|
|
18
|
+
});
|
|
19
|
+
it("variant='compact' with extra -> 'ux4g-time-slot-compact-container my'", () => {
|
|
20
|
+
expect(buildSlotGridClasses('compact', 'my')).toBe('ux4g-time-slot-compact-container my');
|
|
21
|
+
});
|
|
22
|
+
});
|
|
23
|
+
// ── Footer ────────────────────────────────────────────────────────────────────
|
|
24
|
+
describe('buildFooterClasses', () => {
|
|
25
|
+
it("no args -> ''", () => {
|
|
26
|
+
expect(buildFooterClasses()).toBe('');
|
|
27
|
+
});
|
|
28
|
+
it("theme='default' -> ''", () => {
|
|
29
|
+
expect(buildFooterClasses('default')).toBe('');
|
|
30
|
+
});
|
|
31
|
+
it("theme='primary' -> 'ux4g-footer-primary'", () => {
|
|
32
|
+
expect(buildFooterClasses('primary')).toBe('ux4g-footer-primary');
|
|
33
|
+
});
|
|
34
|
+
it("theme='dark' -> 'ux4g-footer-dark'", () => {
|
|
35
|
+
expect(buildFooterClasses('dark')).toBe('ux4g-footer-dark');
|
|
36
|
+
});
|
|
37
|
+
it("theme='primary' with extra -> 'ux4g-footer-primary extra'", () => {
|
|
38
|
+
expect(buildFooterClasses('primary', 'extra')).toBe('ux4g-footer-primary extra');
|
|
39
|
+
});
|
|
40
|
+
it("theme='dark' with extra -> 'ux4g-footer-dark extra'", () => {
|
|
41
|
+
expect(buildFooterClasses('dark', 'extra')).toBe('ux4g-footer-dark extra');
|
|
42
|
+
});
|
|
43
|
+
it("theme='default' with extra -> 'extra'", () => {
|
|
44
|
+
expect(buildFooterClasses('default', 'extra')).toBe('extra');
|
|
45
|
+
});
|
|
46
|
+
});
|
|
47
|
+
// ── ResultListRow ─────────────────────────────────────────────────────────────
|
|
48
|
+
describe('buildResultListRowClasses', () => {
|
|
49
|
+
it("no args -> 'ux4g-result-list'", () => {
|
|
50
|
+
expect(buildResultListRowClasses()).toBe('ux4g-result-list');
|
|
51
|
+
});
|
|
52
|
+
it("variation='default' -> 'ux4g-result-list'", () => {
|
|
53
|
+
expect(buildResultListRowClasses('default')).toBe('ux4g-result-list');
|
|
54
|
+
});
|
|
55
|
+
it("variation='v1' -> 'ux4g-result-list ux4g-result-list-v1'", () => {
|
|
56
|
+
expect(buildResultListRowClasses('v1')).toBe('ux4g-result-list ux4g-result-list-v1');
|
|
57
|
+
});
|
|
58
|
+
it("variation='v2' -> 'ux4g-result-list ux4g-result-list-v2'", () => {
|
|
59
|
+
expect(buildResultListRowClasses('v2')).toBe('ux4g-result-list ux4g-result-list-v2');
|
|
60
|
+
});
|
|
61
|
+
it("variation='v3' -> 'ux4g-result-list ux4g-result-list-v3'", () => {
|
|
62
|
+
expect(buildResultListRowClasses('v3')).toBe('ux4g-result-list ux4g-result-list-v3');
|
|
63
|
+
});
|
|
64
|
+
it("variation='v4' -> 'ux4g-result-list ux4g-result-list-v4'", () => {
|
|
65
|
+
expect(buildResultListRowClasses('v4')).toBe('ux4g-result-list ux4g-result-list-v4');
|
|
66
|
+
});
|
|
67
|
+
it("variation='v5' -> 'ux4g-result-list ux4g-result-list-v5'", () => {
|
|
68
|
+
expect(buildResultListRowClasses('v5')).toBe('ux4g-result-list ux4g-result-list-v5');
|
|
69
|
+
});
|
|
70
|
+
it("variation='v3' with extra -> 'ux4g-result-list ux4g-result-list-v3 extra'", () => {
|
|
71
|
+
expect(buildResultListRowClasses('v3', 'extra')).toBe('ux4g-result-list ux4g-result-list-v3 extra');
|
|
72
|
+
});
|
|
73
|
+
it("variation='v5' with extra -> 'ux4g-result-list ux4g-result-list-v5 extra'", () => {
|
|
74
|
+
expect(buildResultListRowClasses('v5', 'extra')).toBe('ux4g-result-list ux4g-result-list-v5 extra');
|
|
75
|
+
});
|
|
76
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Property-based tests for Phase 3 build functions
|
|
3
|
+
* Properties 1-6
|
|
4
|
+
* Tag: Feature: ux4g-phase3-components
|
|
5
|
+
*/
|
|
6
|
+
import * as fc from 'fast-check';
|
|
7
|
+
import { buildLinkClasses, buildBadgeClasses, buildAvatarClasses, buildImageContainerClasses, } from '../../src/types';
|
|
8
|
+
const allLinkVariants = ['default', 'neutral'];
|
|
9
|
+
const allLinkSizes = ['sm', 'md'];
|
|
10
|
+
const allBadgeTypes = ['dot', 'icon', 'digit'];
|
|
11
|
+
const allBadgeColors = ['primary', 'success', 'warning', 'danger', 'info', 'secondary', 'tertiary', 'neutral'];
|
|
12
|
+
const allBadgeSizes = ['s', 'm', 'l', 'profile-l', 'profile-xl', 'profile-2xl', 'profile-3xl'];
|
|
13
|
+
const allAvatarTypes = ['status', 'profile', 'group'];
|
|
14
|
+
const allAvatarSizes = ['xs', 's', 'm', 'l', 'xl', '2xl', '3xl'];
|
|
15
|
+
const allImageRatios = ['1-1', '4-3', '3-2', '16-10', '16-9', '2-1', '5-2', '3-1', '1-16', '2-3', '3-4'];
|
|
16
|
+
/**
|
|
17
|
+
* Property 1: Link class matches variant × size
|
|
18
|
+
* Tag: Feature: ux4g-phase3-components, Property 1
|
|
19
|
+
*/
|
|
20
|
+
describe('Property 1: Link class matches variant × size', () => {
|
|
21
|
+
it('Feature: ux4g-phase3-components, Property 1', () => {
|
|
22
|
+
fc.assert(fc.property(fc.constantFrom(...allLinkVariants), fc.constantFrom(...allLinkSizes), (variant, size) => {
|
|
23
|
+
const result = buildLinkClasses(variant, size);
|
|
24
|
+
if (variant === 'neutral') {
|
|
25
|
+
return result.includes('neutral');
|
|
26
|
+
}
|
|
27
|
+
else {
|
|
28
|
+
return !result.includes('neutral');
|
|
29
|
+
}
|
|
30
|
+
}), { numRuns: 20 });
|
|
31
|
+
});
|
|
32
|
+
});
|
|
33
|
+
/**
|
|
34
|
+
* Property 2: Badge class contains type and color substrings
|
|
35
|
+
* Property 3: Badge size class appended when provided
|
|
36
|
+
* Tag: Feature: ux4g-phase3-components, Property 2 & 3
|
|
37
|
+
*/
|
|
38
|
+
describe('Property 2: Badge class contains type and color substrings', () => {
|
|
39
|
+
it('Feature: ux4g-phase3-components, Property 2', () => {
|
|
40
|
+
fc.assert(fc.property(fc.constantFrom(...allBadgeTypes), fc.constantFrom(...allBadgeColors), (type, color) => {
|
|
41
|
+
const result = buildBadgeClasses(type, color);
|
|
42
|
+
return result.includes(`ux4g-badge-${type}-${color}`);
|
|
43
|
+
}), { numRuns: 20 });
|
|
44
|
+
});
|
|
45
|
+
});
|
|
46
|
+
describe('Property 3: Badge size class appended when provided', () => {
|
|
47
|
+
it('Feature: ux4g-phase3-components, Property 3', () => {
|
|
48
|
+
fc.assert(fc.property(fc.constantFrom(...allBadgeTypes), fc.constantFrom(...allBadgeColors), fc.constantFrom(...allBadgeSizes), (type, color, size) => {
|
|
49
|
+
const result = buildBadgeClasses(type, color, size);
|
|
50
|
+
return result.includes(`ux4g-badge-${size}`);
|
|
51
|
+
}), { numRuns: 20 });
|
|
52
|
+
});
|
|
53
|
+
});
|
|
54
|
+
/**
|
|
55
|
+
* Property 4: Avatar group class is standalone
|
|
56
|
+
* Property 5: Avatar status/profile always includes base class
|
|
57
|
+
* Tag: Feature: ux4g-phase3-components, Property 4 & 5
|
|
58
|
+
*/
|
|
59
|
+
describe('Property 4: Avatar group class is standalone', () => {
|
|
60
|
+
it('Feature: ux4g-phase3-components, Property 4', () => {
|
|
61
|
+
expect(buildAvatarClasses('group')).toBe('ux4g-avatar-group');
|
|
62
|
+
});
|
|
63
|
+
});
|
|
64
|
+
describe('Property 5: Avatar status/profile always includes base class', () => {
|
|
65
|
+
it('Feature: ux4g-phase3-components, Property 5', () => {
|
|
66
|
+
fc.assert(fc.property(fc.constantFrom('status', 'profile'), fc.option(fc.constantFrom(...allAvatarSizes), { nil: undefined }), (avatarType, size) => {
|
|
67
|
+
const result = buildAvatarClasses(avatarType, size);
|
|
68
|
+
return result.startsWith('ux4g-avatar ');
|
|
69
|
+
}), { numRuns: 20 });
|
|
70
|
+
});
|
|
71
|
+
});
|
|
72
|
+
/**
|
|
73
|
+
* Property 6: Image container class contains ratio when provided
|
|
74
|
+
* Tag: Feature: ux4g-phase3-components, Property 6
|
|
75
|
+
*/
|
|
76
|
+
describe('Property 6: Image container class contains ratio when provided', () => {
|
|
77
|
+
it('Feature: ux4g-phase3-components, Property 6', () => {
|
|
78
|
+
fc.assert(fc.property(fc.constantFrom(...allImageRatios), (ratio) => {
|
|
79
|
+
const result = buildImageContainerClasses(ratio);
|
|
80
|
+
return result.includes(`ux4g-ratio-${ratio}`);
|
|
81
|
+
}), { numRuns: 20 });
|
|
82
|
+
});
|
|
83
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Unit tests for Phase 3 build functions
|
|
3
|
+
* Validates: Requirements 4.3, 4.7, 4.10, 4.12
|
|
4
|
+
*/
|
|
5
|
+
import { buildLinkClasses, buildBadgeClasses, buildAvatarClasses, buildImageContainerClasses, } from '../../src/types';
|
|
6
|
+
describe('buildLinkClasses', () => {
|
|
7
|
+
it('default variant + sm → ux4g-text-link-sm', () => {
|
|
8
|
+
expect(buildLinkClasses('default', 'sm')).toBe('ux4g-text-link-sm');
|
|
9
|
+
});
|
|
10
|
+
it('default variant + md → ux4g-text-link-md', () => {
|
|
11
|
+
expect(buildLinkClasses('default', 'md')).toBe('ux4g-text-link-md');
|
|
12
|
+
});
|
|
13
|
+
it('neutral variant + sm → ux4g-text-link-neutral-sm', () => {
|
|
14
|
+
expect(buildLinkClasses('neutral', 'sm')).toBe('ux4g-text-link-neutral-sm');
|
|
15
|
+
});
|
|
16
|
+
it('neutral variant + md → ux4g-text-link-neutral-md', () => {
|
|
17
|
+
expect(buildLinkClasses('neutral', 'md')).toBe('ux4g-text-link-neutral-md');
|
|
18
|
+
});
|
|
19
|
+
it('appends extra class when provided', () => {
|
|
20
|
+
expect(buildLinkClasses('default', 'sm', 'my-class')).toBe('ux4g-text-link-sm my-class');
|
|
21
|
+
});
|
|
22
|
+
});
|
|
23
|
+
describe('buildBadgeClasses', () => {
|
|
24
|
+
it('dot + primary → ux4g-badge-dot-primary', () => {
|
|
25
|
+
expect(buildBadgeClasses('dot', 'primary')).toBe('ux4g-badge-dot-primary');
|
|
26
|
+
});
|
|
27
|
+
it('icon + success + m → ux4g-badge-icon-success ux4g-badge-m', () => {
|
|
28
|
+
expect(buildBadgeClasses('icon', 'success', 'm')).toBe('ux4g-badge-icon-success ux4g-badge-m');
|
|
29
|
+
});
|
|
30
|
+
it('digit + danger + profile-xl → ux4g-badge-digit-danger ux4g-badge-profile-xl', () => {
|
|
31
|
+
expect(buildBadgeClasses('digit', 'danger', 'profile-xl')).toBe('ux4g-badge-digit-danger ux4g-badge-profile-xl');
|
|
32
|
+
});
|
|
33
|
+
it('no size → no size class appended', () => {
|
|
34
|
+
expect(buildBadgeClasses('dot', 'neutral')).toBe('ux4g-badge-dot-neutral');
|
|
35
|
+
});
|
|
36
|
+
it('appends extra class when provided', () => {
|
|
37
|
+
expect(buildBadgeClasses('dot', 'primary', undefined, 'extra')).toBe('ux4g-badge-dot-primary extra');
|
|
38
|
+
});
|
|
39
|
+
});
|
|
40
|
+
describe('buildAvatarClasses', () => {
|
|
41
|
+
it('group → ux4g-avatar-group (no base class)', () => {
|
|
42
|
+
expect(buildAvatarClasses('group')).toBe('ux4g-avatar-group');
|
|
43
|
+
});
|
|
44
|
+
it('status + s → ux4g-avatar ux4g-avatar-status ux4g-avatar-s', () => {
|
|
45
|
+
expect(buildAvatarClasses('status', 's')).toBe('ux4g-avatar ux4g-avatar-status ux4g-avatar-s');
|
|
46
|
+
});
|
|
47
|
+
it('profile + xl → ux4g-avatar ux4g-avatar-profile ux4g-avatar-xl', () => {
|
|
48
|
+
expect(buildAvatarClasses('profile', 'xl')).toBe('ux4g-avatar ux4g-avatar-profile ux4g-avatar-xl');
|
|
49
|
+
});
|
|
50
|
+
it('status without size → ux4g-avatar ux4g-avatar-status', () => {
|
|
51
|
+
expect(buildAvatarClasses('status')).toBe('ux4g-avatar ux4g-avatar-status');
|
|
52
|
+
});
|
|
53
|
+
it('group with extra → ux4g-avatar-group extra', () => {
|
|
54
|
+
expect(buildAvatarClasses('group', undefined, 'extra')).toBe('ux4g-avatar-group extra');
|
|
55
|
+
});
|
|
56
|
+
});
|
|
57
|
+
describe('buildImageContainerClasses', () => {
|
|
58
|
+
it('no args → empty string', () => {
|
|
59
|
+
expect(buildImageContainerClasses()).toBe('');
|
|
60
|
+
});
|
|
61
|
+
it('ratio only → ux4g-ratio-16-9', () => {
|
|
62
|
+
expect(buildImageContainerClasses('16-9')).toBe('ux4g-ratio-16-9');
|
|
63
|
+
});
|
|
64
|
+
it('ratio + rounded + overlay → ux4g-img-overlay ux4g-img-rounded ux4g-ratio-16-9', () => {
|
|
65
|
+
expect(buildImageContainerClasses('16-9', true, true)).toBe('ux4g-img-overlay ux4g-img-rounded ux4g-ratio-16-9');
|
|
66
|
+
});
|
|
67
|
+
it('rounded only → ux4g-img-rounded', () => {
|
|
68
|
+
expect(buildImageContainerClasses(undefined, true)).toBe('ux4g-img-rounded');
|
|
69
|
+
});
|
|
70
|
+
it('overlay only → ux4g-img-overlay', () => {
|
|
71
|
+
expect(buildImageContainerClasses(undefined, false, true)).toBe('ux4g-img-overlay');
|
|
72
|
+
});
|
|
73
|
+
it('appends extra class when provided', () => {
|
|
74
|
+
expect(buildImageContainerClasses('4-3', false, false, 'extra')).toBe('ux4g-ratio-4-3 extra');
|
|
75
|
+
});
|
|
76
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Property-based tests for Phase 4 build functions
|
|
3
|
+
*
|
|
4
|
+
* Property 1: Chip class contains chipType and size substrings
|
|
5
|
+
* Property 2: Chip active class appended when active=true
|
|
6
|
+
* Property 3: Chip xs size clamped to sm for filter/choice types
|
|
7
|
+
* Property 4: Tag class contains variant and color substrings
|
|
8
|
+
* Property 5: Tag small class appended when small=true
|
|
9
|
+
* Property 6: Divider class matches orientation
|
|
10
|
+
* Property 7: Breadcrumb class contains separator substring
|
|
11
|
+
*/
|
|
12
|
+
import * as fc from 'fast-check';
|
|
13
|
+
import { buildChipClasses, buildTagClasses, buildDividerClasses, buildBreadcrumbClasses, } from '../../src/types';
|
|
14
|
+
const allChipTypes = ['filter', 'choice', 'input'];
|
|
15
|
+
const allChipSizes = ['md', 'sm', 'xs'];
|
|
16
|
+
const allTagVariants = ['tonal', 'filled', 'outline', 'text'];
|
|
17
|
+
const allTagColors = ['neutral', 'brand', 'success', 'warning', 'error', 'info'];
|
|
18
|
+
/**
|
|
19
|
+
* Property 1: Chip class contains chipType and size substrings
|
|
20
|
+
* Tag: Feature: ux4g-phase4-components, Property 1
|
|
21
|
+
* Validates: Requirements 3.6, 4.3
|
|
22
|
+
*/
|
|
23
|
+
describe('Property 1: Chip class contains chipType and size substrings', () => {
|
|
24
|
+
it('Feature: ux4g-phase4-components, Property 1', () => {
|
|
25
|
+
fc.assert(fc.property(fc.constantFrom(...allChipTypes), fc.constantFrom(...allChipSizes), (chipType, size) => {
|
|
26
|
+
const result = buildChipClasses(chipType, size);
|
|
27
|
+
const effectiveSize = (chipType !== 'input' && size === 'xs') ? 'sm' : size;
|
|
28
|
+
return result.includes(chipType) && result.includes(effectiveSize);
|
|
29
|
+
}), { numRuns: 20 });
|
|
30
|
+
});
|
|
31
|
+
});
|
|
32
|
+
/**
|
|
33
|
+
* Property 2: Chip active class appended when active=true
|
|
34
|
+
* Tag: Feature: ux4g-phase4-components, Property 2
|
|
35
|
+
* Validates: Requirements 3.7, 5.5
|
|
36
|
+
*/
|
|
37
|
+
describe('Property 2: Chip active class appended when active=true', () => {
|
|
38
|
+
it('Feature: ux4g-phase4-components, Property 2', () => {
|
|
39
|
+
fc.assert(fc.property(fc.constantFrom(...allChipTypes), fc.constantFrom(...allChipSizes), fc.boolean(), (chipType, size, active) => {
|
|
40
|
+
const result = buildChipClasses(chipType, size, active);
|
|
41
|
+
if (active) {
|
|
42
|
+
return result.includes('active');
|
|
43
|
+
}
|
|
44
|
+
else {
|
|
45
|
+
return !result.includes('active');
|
|
46
|
+
}
|
|
47
|
+
}), { numRuns: 20 });
|
|
48
|
+
});
|
|
49
|
+
});
|
|
50
|
+
/**
|
|
51
|
+
* Property 3: Chip xs size clamped to sm for filter/choice types
|
|
52
|
+
* Tag: Feature: ux4g-phase4-components, Property 3
|
|
53
|
+
* Validates: Requirements 4.3, 10.8
|
|
54
|
+
*/
|
|
55
|
+
describe('Property 3: Chip xs size clamped to sm for filter/choice types', () => {
|
|
56
|
+
it('Feature: ux4g-phase4-components, Property 3', () => {
|
|
57
|
+
fc.assert(fc.property(fc.constantFrom('filter', 'choice'), (chipType) => {
|
|
58
|
+
const result = buildChipClasses(chipType, 'xs');
|
|
59
|
+
return result.includes('chip-sm') && !result.includes('chip-xs');
|
|
60
|
+
}), { numRuns: 20 });
|
|
61
|
+
});
|
|
62
|
+
});
|
|
63
|
+
/**
|
|
64
|
+
* Property 4: Tag class contains variant and color substrings
|
|
65
|
+
* Tag: Feature: ux4g-phase4-components, Property 4
|
|
66
|
+
* Validates: Requirements 3.8, 4.6
|
|
67
|
+
*/
|
|
68
|
+
describe('Property 4: Tag class contains variant and color substrings', () => {
|
|
69
|
+
it('Feature: ux4g-phase4-components, Property 4', () => {
|
|
70
|
+
fc.assert(fc.property(fc.constantFrom(...allTagVariants), fc.constantFrom(...allTagColors), (variant, color) => {
|
|
71
|
+
const result = buildTagClasses(variant, color);
|
|
72
|
+
return result.includes(variant) && result.includes(color);
|
|
73
|
+
}), { numRuns: 20 });
|
|
74
|
+
});
|
|
75
|
+
});
|
|
76
|
+
/**
|
|
77
|
+
* Property 5: Tag small class appended when small=true
|
|
78
|
+
* Tag: Feature: ux4g-phase4-components, Property 5
|
|
79
|
+
* Validates: Requirements 3.9, 6.5
|
|
80
|
+
*/
|
|
81
|
+
describe('Property 5: Tag small class appended when small=true', () => {
|
|
82
|
+
it('Feature: ux4g-phase4-components, Property 5', () => {
|
|
83
|
+
fc.assert(fc.property(fc.constantFrom(...allTagVariants), fc.constantFrom(...allTagColors), fc.boolean(), (variant, color, small) => {
|
|
84
|
+
const result = buildTagClasses(variant, color, small);
|
|
85
|
+
if (small) {
|
|
86
|
+
return result.includes('ux4g-tag-s');
|
|
87
|
+
}
|
|
88
|
+
else {
|
|
89
|
+
return !result.includes('ux4g-tag-s');
|
|
90
|
+
}
|
|
91
|
+
}), { numRuns: 20 });
|
|
92
|
+
});
|
|
93
|
+
});
|
|
94
|
+
/**
|
|
95
|
+
* Property 6: Divider class matches orientation
|
|
96
|
+
* Tag: Feature: ux4g-phase4-components, Property 6
|
|
97
|
+
* Validates: Requirements 3.10, 4.8
|
|
98
|
+
*/
|
|
99
|
+
describe('Property 6: Divider class matches orientation', () => {
|
|
100
|
+
it('Feature: ux4g-phase4-components, Property 6', () => {
|
|
101
|
+
fc.assert(fc.property(fc.constantFrom('horizontal', 'vertical'), (orientation) => {
|
|
102
|
+
const result = buildDividerClasses(orientation);
|
|
103
|
+
return result === `ux4g-divider-${orientation}`;
|
|
104
|
+
}), { numRuns: 20 });
|
|
105
|
+
});
|
|
106
|
+
});
|
|
107
|
+
/**
|
|
108
|
+
* Property 7: Breadcrumb class contains separator substring
|
|
109
|
+
* Tag: Feature: ux4g-phase4-components, Property 7
|
|
110
|
+
* Validates: Requirements 3.11, 4.10
|
|
111
|
+
*/
|
|
112
|
+
describe('Property 7: Breadcrumb class contains separator substring', () => {
|
|
113
|
+
it('Feature: ux4g-phase4-components, Property 7', () => {
|
|
114
|
+
fc.assert(fc.property(fc.constantFrom('divider', 'icon'), (separator) => {
|
|
115
|
+
const result = buildBreadcrumbClasses(separator);
|
|
116
|
+
return result.includes('ux4g-breadcrumb') && result.includes(`ux4g-breadcrumb-${separator}`);
|
|
117
|
+
}), { numRuns: 20 });
|
|
118
|
+
});
|
|
119
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Unit tests for Phase 4 build functions
|
|
3
|
+
* Validates: Requirements 4.3, 4.6, 4.8, 4.10
|
|
4
|
+
*/
|
|
5
|
+
import { buildChipClasses, buildTagClasses, buildDividerClasses, buildBreadcrumbClasses, } from '../../src/types';
|
|
6
|
+
describe('buildChipClasses', () => {
|
|
7
|
+
it('filter xs clamped to sm', () => {
|
|
8
|
+
expect(buildChipClasses('filter', 'xs')).toBe('ux4g-filter-chip-sm');
|
|
9
|
+
});
|
|
10
|
+
it('choice xs clamped to sm with active', () => {
|
|
11
|
+
expect(buildChipClasses('choice', 'xs', true)).toBe('ux4g-choice-chip-sm active');
|
|
12
|
+
});
|
|
13
|
+
it('input xs is valid (not clamped)', () => {
|
|
14
|
+
expect(buildChipClasses('input', 'xs')).toBe('ux4g-input-chip-xs');
|
|
15
|
+
});
|
|
16
|
+
it('filter md', () => {
|
|
17
|
+
expect(buildChipClasses('filter', 'md')).toBe('ux4g-filter-chip-md');
|
|
18
|
+
});
|
|
19
|
+
it('choice sm with active', () => {
|
|
20
|
+
expect(buildChipClasses('choice', 'sm', true)).toBe('ux4g-choice-chip-sm active');
|
|
21
|
+
});
|
|
22
|
+
it('active=false does not append active', () => {
|
|
23
|
+
expect(buildChipClasses('filter', 'md', false)).toBe('ux4g-filter-chip-md');
|
|
24
|
+
});
|
|
25
|
+
it('extra class appended', () => {
|
|
26
|
+
expect(buildChipClasses('input', 'sm', false, 'my-class')).toBe('ux4g-input-chip-sm my-class');
|
|
27
|
+
});
|
|
28
|
+
});
|
|
29
|
+
describe('buildTagClasses', () => {
|
|
30
|
+
it('tonal brand', () => {
|
|
31
|
+
expect(buildTagClasses('tonal', 'brand')).toBe('ux4g-tag-tonal-brand');
|
|
32
|
+
});
|
|
33
|
+
it('filled error with small', () => {
|
|
34
|
+
expect(buildTagClasses('filled', 'error', true)).toBe('ux4g-tag-filled-error ux4g-tag-s');
|
|
35
|
+
});
|
|
36
|
+
it('outline success with small', () => {
|
|
37
|
+
expect(buildTagClasses('outline', 'success', true)).toBe('ux4g-tag-outline-success ux4g-tag-s');
|
|
38
|
+
});
|
|
39
|
+
it('text neutral', () => {
|
|
40
|
+
expect(buildTagClasses('text', 'neutral')).toBe('ux4g-tag-text-neutral');
|
|
41
|
+
});
|
|
42
|
+
it('small=false does not append ux4g-tag-s', () => {
|
|
43
|
+
expect(buildTagClasses('tonal', 'brand', false)).toBe('ux4g-tag-tonal-brand');
|
|
44
|
+
});
|
|
45
|
+
it('extra class appended', () => {
|
|
46
|
+
expect(buildTagClasses('filled', 'info', false, 'my-class')).toBe('ux4g-tag-filled-info my-class');
|
|
47
|
+
});
|
|
48
|
+
});
|
|
49
|
+
describe('buildDividerClasses', () => {
|
|
50
|
+
it('horizontal', () => {
|
|
51
|
+
expect(buildDividerClasses('horizontal')).toBe('ux4g-divider-horizontal');
|
|
52
|
+
});
|
|
53
|
+
it('vertical', () => {
|
|
54
|
+
expect(buildDividerClasses('vertical')).toBe('ux4g-divider-vertical');
|
|
55
|
+
});
|
|
56
|
+
it('extra class appended', () => {
|
|
57
|
+
expect(buildDividerClasses('horizontal', 'my-class')).toBe('ux4g-divider-horizontal my-class');
|
|
58
|
+
});
|
|
59
|
+
});
|
|
60
|
+
describe('buildBreadcrumbClasses', () => {
|
|
61
|
+
it('divider separator', () => {
|
|
62
|
+
expect(buildBreadcrumbClasses('divider')).toBe('ux4g-breadcrumb ux4g-breadcrumb-divider');
|
|
63
|
+
});
|
|
64
|
+
it('icon separator', () => {
|
|
65
|
+
expect(buildBreadcrumbClasses('icon')).toBe('ux4g-breadcrumb ux4g-breadcrumb-icon');
|
|
66
|
+
});
|
|
67
|
+
it('extra class appended', () => {
|
|
68
|
+
expect(buildBreadcrumbClasses('divider', 'my-class')).toBe('ux4g-breadcrumb ux4g-breadcrumb-divider my-class');
|
|
69
|
+
});
|
|
70
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Property-based tests for Phase 5 build functions
|
|
3
|
+
*
|
|
4
|
+
* Property 1: Checkbox class contains size substring
|
|
5
|
+
* Property 2: Checkbox error class appended when error=true
|
|
6
|
+
* Property 3: Radio class contains size substring
|
|
7
|
+
* Property 4: Radio error class appended when error=true
|
|
8
|
+
* Property 5: Switch class contains size substring and never contains error class
|
|
9
|
+
* Property 6: Card class contains variant and layout substrings
|
|
10
|
+
* Property 7: Input container class contains size and state substrings
|
|
11
|
+
*/
|
|
12
|
+
import * as fc from 'fast-check';
|
|
13
|
+
import { buildCheckboxClasses, buildRadioClasses, buildSwitchClasses, buildCardClasses, buildInputContainerClasses, } from '../../src/types';
|
|
14
|
+
/**
|
|
15
|
+
* Property 1: Checkbox class contains size substring
|
|
16
|
+
* Tag: Feature: ux4g-phase5-components, Property 1
|
|
17
|
+
* Validates: Requirements 3.7, 4.2
|
|
18
|
+
*/
|
|
19
|
+
describe('Property 1: Checkbox class contains size substring', () => {
|
|
20
|
+
it('Feature: ux4g-phase5-components, Property 1', () => {
|
|
21
|
+
fc.assert(fc.property(fc.constantFrom('sm', 'md', 'lg'), (size) => {
|
|
22
|
+
const result = buildCheckboxClasses(size);
|
|
23
|
+
return result.includes('ux4g-checkbox') && result.includes(`ux4g-checkbox-${size}`);
|
|
24
|
+
}), { numRuns: 20 });
|
|
25
|
+
});
|
|
26
|
+
});
|
|
27
|
+
/**
|
|
28
|
+
* Property 2: Checkbox error class appended when error=true
|
|
29
|
+
* Tag: Feature: ux4g-phase5-components, Property 2
|
|
30
|
+
* Validates: Requirements 3.8, 4.2
|
|
31
|
+
*/
|
|
32
|
+
describe('Property 2: Checkbox error class appended when error=true', () => {
|
|
33
|
+
it('Feature: ux4g-phase5-components, Property 2', () => {
|
|
34
|
+
fc.assert(fc.property(fc.constantFrom('sm', 'md', 'lg'), fc.boolean(), (size, error) => {
|
|
35
|
+
const result = buildCheckboxClasses(size, error);
|
|
36
|
+
if (error) {
|
|
37
|
+
return result.includes('ux4g-checkbox-error');
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
return !result.includes('ux4g-checkbox-error');
|
|
41
|
+
}
|
|
42
|
+
}), { numRuns: 20 });
|
|
43
|
+
});
|
|
44
|
+
});
|
|
45
|
+
/**
|
|
46
|
+
* Property 3: Radio class contains size substring
|
|
47
|
+
* Tag: Feature: ux4g-phase5-components, Property 3
|
|
48
|
+
* Validates: Requirements 3.9, 4.4
|
|
49
|
+
*/
|
|
50
|
+
describe('Property 3: Radio class contains size substring', () => {
|
|
51
|
+
it('Feature: ux4g-phase5-components, Property 3', () => {
|
|
52
|
+
fc.assert(fc.property(fc.constantFrom('sm', 'md', 'lg'), (size) => {
|
|
53
|
+
const result = buildRadioClasses(size);
|
|
54
|
+
return result.includes('ux4g-radio') && result.includes(`ux4g-radio-${size}`);
|
|
55
|
+
}), { numRuns: 20 });
|
|
56
|
+
});
|
|
57
|
+
});
|
|
58
|
+
/**
|
|
59
|
+
* Property 4: Radio error class appended when error=true
|
|
60
|
+
* Tag: Feature: ux4g-phase5-components, Property 4
|
|
61
|
+
* Validates: Requirements 3.10, 4.4
|
|
62
|
+
*/
|
|
63
|
+
describe('Property 4: Radio error class appended when error=true', () => {
|
|
64
|
+
it('Feature: ux4g-phase5-components, Property 4', () => {
|
|
65
|
+
fc.assert(fc.property(fc.constantFrom('sm', 'md', 'lg'), fc.boolean(), (size, error) => {
|
|
66
|
+
const result = buildRadioClasses(size, error);
|
|
67
|
+
if (error) {
|
|
68
|
+
return result.includes('ux4g-radio-error');
|
|
69
|
+
}
|
|
70
|
+
else {
|
|
71
|
+
return !result.includes('ux4g-radio-error');
|
|
72
|
+
}
|
|
73
|
+
}), { numRuns: 20 });
|
|
74
|
+
});
|
|
75
|
+
});
|
|
76
|
+
/**
|
|
77
|
+
* Property 5: Switch class contains size substring and never contains error class
|
|
78
|
+
* Tag: Feature: ux4g-phase5-components, Property 5
|
|
79
|
+
* Validates: Requirements 3.11, 4.6
|
|
80
|
+
*/
|
|
81
|
+
describe('Property 5: Switch class contains size substring and never contains error class', () => {
|
|
82
|
+
it('Feature: ux4g-phase5-components, Property 5', () => {
|
|
83
|
+
fc.assert(fc.property(fc.constantFrom('sm', 'md', 'lg'), (size) => {
|
|
84
|
+
const result = buildSwitchClasses(size);
|
|
85
|
+
return (result.includes('ux4g-switch') &&
|
|
86
|
+
result.includes(`ux4g-switch-${size}`) &&
|
|
87
|
+
!result.includes('ux4g-switch-error'));
|
|
88
|
+
}), { numRuns: 20 });
|
|
89
|
+
});
|
|
90
|
+
});
|
|
91
|
+
/**
|
|
92
|
+
* Property 6: Card class contains variant and layout substrings
|
|
93
|
+
* Tag: Feature: ux4g-phase5-components, Property 6
|
|
94
|
+
* Validates: Requirements 3.12, 4.9
|
|
95
|
+
*/
|
|
96
|
+
describe('Property 6: Card class contains variant and layout substrings', () => {
|
|
97
|
+
it('Feature: ux4g-phase5-components, Property 6', () => {
|
|
98
|
+
fc.assert(fc.property(fc.constantFrom('solid', 'outline', 'no-fill'), fc.constantFrom('vertical', 'horizontal'), (variant, layout) => {
|
|
99
|
+
const result = buildCardClasses(variant, layout);
|
|
100
|
+
return (result.includes('ux4g-card') &&
|
|
101
|
+
result.includes(`ux4g-card-${variant}`) &&
|
|
102
|
+
result.includes(`ux4g-card-${layout}`));
|
|
103
|
+
}), { numRuns: 20 });
|
|
104
|
+
});
|
|
105
|
+
});
|
|
106
|
+
/**
|
|
107
|
+
* Property 7: Input container class contains size and state substrings
|
|
108
|
+
* Tag: Feature: ux4g-phase5-components, Property 7
|
|
109
|
+
* Validates: Requirements 3.13, 4.12
|
|
110
|
+
*/
|
|
111
|
+
describe('Property 7: Input container class contains size and state substrings', () => {
|
|
112
|
+
it('Feature: ux4g-phase5-components, Property 7', () => {
|
|
113
|
+
fc.assert(fc.property(fc.constantFrom('sm', 'md', 'lg', 'xl'), fc.constantFrom('default', 'error', 'success', 'warning'), (size, state) => {
|
|
114
|
+
const result = buildInputContainerClasses(size, state);
|
|
115
|
+
return (result.includes('ux4g-input-container') &&
|
|
116
|
+
result.includes(`ux4g-input-${size}`) &&
|
|
117
|
+
result.includes(`ux4g-input-${state}`));
|
|
118
|
+
}), { numRuns: 20 });
|
|
119
|
+
});
|
|
120
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { buildCheckboxClasses, buildRadioClasses, buildSwitchClasses, buildCardClasses, buildInputContainerClasses, } from '../../src/types';
|
|
2
|
+
// ── buildCheckboxClasses ──────────────────────────────────────────────────────
|
|
3
|
+
describe('buildCheckboxClasses', () => {
|
|
4
|
+
it('md with no error → base + size classes only', () => {
|
|
5
|
+
expect(buildCheckboxClasses('md')).toBe('ux4g-checkbox ux4g-checkbox-md');
|
|
6
|
+
});
|
|
7
|
+
it('sm with error=true → includes error class', () => {
|
|
8
|
+
expect(buildCheckboxClasses('sm', true)).toBe('ux4g-checkbox ux4g-checkbox-sm ux4g-checkbox-error');
|
|
9
|
+
});
|
|
10
|
+
it('lg with error=false → no error class', () => {
|
|
11
|
+
expect(buildCheckboxClasses('lg', false)).toBe('ux4g-checkbox ux4g-checkbox-lg');
|
|
12
|
+
});
|
|
13
|
+
});
|
|
14
|
+
// ── buildRadioClasses ─────────────────────────────────────────────────────────
|
|
15
|
+
describe('buildRadioClasses', () => {
|
|
16
|
+
it('md with no error → base + size classes only', () => {
|
|
17
|
+
expect(buildRadioClasses('md')).toBe('ux4g-radio ux4g-radio-md');
|
|
18
|
+
});
|
|
19
|
+
it('lg with error=true → includes error class', () => {
|
|
20
|
+
expect(buildRadioClasses('lg', true)).toBe('ux4g-radio ux4g-radio-lg ux4g-radio-error');
|
|
21
|
+
});
|
|
22
|
+
it('sm with error=false → no error class', () => {
|
|
23
|
+
expect(buildRadioClasses('sm', false)).toBe('ux4g-radio ux4g-radio-sm');
|
|
24
|
+
});
|
|
25
|
+
});
|
|
26
|
+
// ── buildSwitchClasses ────────────────────────────────────────────────────────
|
|
27
|
+
describe('buildSwitchClasses', () => {
|
|
28
|
+
it('md → ux4g-switch ux4g-switch-md', () => {
|
|
29
|
+
expect(buildSwitchClasses('md')).toBe('ux4g-switch ux4g-switch-md');
|
|
30
|
+
});
|
|
31
|
+
it('sm → ux4g-switch ux4g-switch-sm', () => {
|
|
32
|
+
expect(buildSwitchClasses('sm')).toBe('ux4g-switch ux4g-switch-sm');
|
|
33
|
+
});
|
|
34
|
+
it('lg → ux4g-switch ux4g-switch-lg', () => {
|
|
35
|
+
expect(buildSwitchClasses('lg')).toBe('ux4g-switch ux4g-switch-lg');
|
|
36
|
+
});
|
|
37
|
+
});
|
|
38
|
+
// ── buildCardClasses ──────────────────────────────────────────────────────────
|
|
39
|
+
describe('buildCardClasses', () => {
|
|
40
|
+
it('solid + vertical → base + variant + layout classes', () => {
|
|
41
|
+
expect(buildCardClasses('solid', 'vertical')).toBe('ux4g-card ux4g-card-solid ux4g-card-vertical');
|
|
42
|
+
});
|
|
43
|
+
it('outline + horizontal → base + variant + layout classes', () => {
|
|
44
|
+
expect(buildCardClasses('outline', 'horizontal')).toBe('ux4g-card ux4g-card-outline ux4g-card-horizontal');
|
|
45
|
+
});
|
|
46
|
+
it('no-fill + vertical → base + variant + layout classes', () => {
|
|
47
|
+
expect(buildCardClasses('no-fill', 'vertical')).toBe('ux4g-card ux4g-card-no-fill ux4g-card-vertical');
|
|
48
|
+
});
|
|
49
|
+
});
|
|
50
|
+
// ── buildInputContainerClasses ────────────────────────────────────────────────
|
|
51
|
+
describe('buildInputContainerClasses', () => {
|
|
52
|
+
it('md + default → base + size + state classes', () => {
|
|
53
|
+
expect(buildInputContainerClasses('md', 'default')).toBe('ux4g-input-container ux4g-input-md ux4g-input-default');
|
|
54
|
+
});
|
|
55
|
+
it('lg + error → base + size + state classes', () => {
|
|
56
|
+
expect(buildInputContainerClasses('lg', 'error')).toBe('ux4g-input-container ux4g-input-lg ux4g-input-error');
|
|
57
|
+
});
|
|
58
|
+
it('sm + success → base + size + state classes', () => {
|
|
59
|
+
expect(buildInputContainerClasses('sm', 'success')).toBe('ux4g-input-container ux4g-input-sm ux4g-input-success');
|
|
60
|
+
});
|
|
61
|
+
it('xl + warning → base + size + state classes', () => {
|
|
62
|
+
expect(buildInputContainerClasses('xl', 'warning')).toBe('ux4g-input-container ux4g-input-xl ux4g-input-warning');
|
|
63
|
+
});
|
|
64
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|