@mytechtoday/augment-extensions 1.3.0 → 1.4.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/LICENSE +22 -22
- package/README.md +105 -6
- package/augment-extensions/domain-rules/software-architecture/README.md +143 -143
- package/augment-extensions/domain-rules/software-architecture/examples/banking-layered.md +961 -961
- package/augment-extensions/domain-rules/software-architecture/examples/ecommerce-microservices.md +990 -990
- package/augment-extensions/domain-rules/software-architecture/examples/iot-eventdriven.md +882 -882
- package/augment-extensions/domain-rules/software-architecture/examples/monolith-to-microservices-migration.md +703 -703
- package/augment-extensions/domain-rules/software-architecture/examples/serverless-imageprocessing.md +957 -957
- package/augment-extensions/domain-rules/software-architecture/examples/trading-eventdriven.md +747 -747
- package/augment-extensions/domain-rules/software-architecture/module.json +119 -119
- package/augment-extensions/domain-rules/software-architecture/rules/challenges-solutions.md +763 -763
- package/augment-extensions/domain-rules/software-architecture/rules/definitions-terminology.md +409 -409
- package/augment-extensions/domain-rules/software-architecture/rules/design-principles.md +684 -684
- package/augment-extensions/domain-rules/software-architecture/rules/evaluation-testing.md +1381 -1381
- package/augment-extensions/domain-rules/software-architecture/rules/event-driven-architecture.md +616 -616
- package/augment-extensions/domain-rules/software-architecture/rules/fundamentals.md +306 -306
- package/augment-extensions/domain-rules/software-architecture/rules/industry-architectures.md +554 -554
- package/augment-extensions/domain-rules/software-architecture/rules/layered-architecture.md +776 -776
- package/augment-extensions/domain-rules/software-architecture/rules/microservices-architecture.md +503 -503
- package/augment-extensions/domain-rules/software-architecture/rules/modeling-documentation.md +1199 -1199
- package/augment-extensions/domain-rules/software-architecture/rules/monolithic-architecture.md +351 -351
- package/augment-extensions/domain-rules/software-architecture/rules/principles.md +556 -556
- package/augment-extensions/domain-rules/software-architecture/rules/quality-attributes.md +797 -797
- package/augment-extensions/domain-rules/software-architecture/rules/scalability-performance.md +1345 -1345
- package/augment-extensions/domain-rules/software-architecture/rules/security-architecture.md +1039 -1039
- package/augment-extensions/domain-rules/software-architecture/rules/serverless-architecture.md +711 -711
- package/augment-extensions/domain-rules/software-architecture/rules/skills-development.md +568 -568
- package/augment-extensions/domain-rules/software-architecture/rules/tools-methodologies.md +961 -961
- package/augment-extensions/visual-design/CHANGELOG.md +132 -132
- package/augment-extensions/visual-design/README.md +255 -255
- package/augment-extensions/visual-design/__tests__/README.md +119 -119
- package/augment-extensions/visual-design/__tests__/style-selector.test.ts +172 -172
- package/augment-extensions/visual-design/__tests__/vendor-styles.test.ts +214 -214
- package/augment-extensions/visual-design/domains/other/ai-prompt-helper.ts +157 -157
- package/augment-extensions/visual-design/domains/other/dotnet-application.ts +156 -156
- package/augment-extensions/visual-design/domains/other/linux-platform.ts +156 -156
- package/augment-extensions/visual-design/domains/other/mobile-application.ts +157 -157
- package/augment-extensions/visual-design/domains/other/motion-picture.ts +156 -156
- package/augment-extensions/visual-design/domains/other/os-application.ts +156 -156
- package/augment-extensions/visual-design/domains/other/print-campaigns.ts +158 -158
- package/augment-extensions/visual-design/domains/other/web-app.ts +157 -157
- package/augment-extensions/visual-design/domains/other/website.ts +161 -161
- package/augment-extensions/visual-design/domains/other/windows-platform.ts +156 -156
- package/augment-extensions/visual-design/domains/web-page-styles/amazon-cloudscape.ts +506 -506
- package/augment-extensions/visual-design/domains/web-page-styles/google-modern.ts +615 -615
- package/augment-extensions/visual-design/domains/web-page-styles/microsoft-fluent.ts +531 -531
- package/augment-extensions/visual-design/examples/README.md +97 -97
- package/augment-extensions/visual-design/examples/ai-prompt-generation.md +233 -233
- package/augment-extensions/visual-design/examples/basic-usage.md +216 -216
- package/augment-extensions/visual-design/examples/domain-workflows.md +257 -257
- package/augment-extensions/visual-design/examples/vendor-comparison.md +247 -247
- package/augment-extensions/visual-design/module.json +78 -78
- package/augment-extensions/visual-design/style-selector.ts +177 -177
- package/augment-extensions/visual-design/types.ts +302 -302
- package/augment-extensions/visual-design/visual-design-core.ts +469 -469
- package/augment-extensions/workflows/adr-support/README.md +227 -227
- package/augment-extensions/workflows/adr-support/__tests__/adr-validator.test.ts +203 -203
- package/augment-extensions/workflows/adr-support/adr-validator.ts +162 -162
- package/augment-extensions/workflows/adr-support/examples/complete-lifecycle-example.md +449 -449
- package/augment-extensions/workflows/adr-support/examples/integration-example.md +580 -580
- package/augment-extensions/workflows/adr-support/examples/superseding-example.md +436 -436
- package/augment-extensions/workflows/adr-support/module.json +112 -112
- package/augment-extensions/workflows/adr-support/rules/adr-creation.md +372 -372
- package/augment-extensions/workflows/adr-support/rules/beads-integration.md +443 -443
- package/augment-extensions/workflows/adr-support/rules/conflict-detection.md +486 -486
- package/augment-extensions/workflows/adr-support/rules/decision-detection.md +362 -362
- package/augment-extensions/workflows/adr-support/rules/lifecycle-management.md +427 -427
- package/augment-extensions/workflows/adr-support/rules/openspec-integration.md +465 -465
- package/augment-extensions/workflows/adr-support/rules/template-selection.md +405 -405
- package/augment-extensions/workflows/adr-support/rules/validation-rules.md +543 -543
- package/augment-extensions/workflows/adr-support/schemas/adr-config.json +191 -191
- package/augment-extensions/workflows/adr-support/schemas/adr-metadata.json +172 -172
- package/augment-extensions/workflows/adr-support/templates/business-case.md +235 -235
- package/augment-extensions/workflows/adr-support/templates/madr-elaborate.md +197 -197
- package/augment-extensions/workflows/adr-support/templates/madr-simple.md +68 -68
- package/augment-extensions/workflows/adr-support/templates/nygard.md +84 -84
- package/augment-extensions/writing-standards/screenplay/rules/file-organization.md +213 -213
- package/augment-extensions/writing-standards/screenplay/utils/__tests__/file-organization.test.ts +169 -169
- package/augment-extensions/writing-standards/screenplay/utils/file-organization.ts +165 -165
- package/cli/dist/commands/agent.d.ts +37 -0
- package/cli/dist/commands/agent.d.ts.map +1 -0
- package/cli/dist/commands/agent.js +222 -0
- package/cli/dist/commands/agent.js.map +1 -0
- package/cli/dist/commands/beads.d.ts +64 -0
- package/cli/dist/commands/beads.d.ts.map +1 -0
- package/cli/dist/commands/beads.js +377 -0
- package/cli/dist/commands/beads.js.map +1 -0
- package/cli/dist/commands/change.d.ts +54 -0
- package/cli/dist/commands/change.d.ts.map +1 -0
- package/cli/dist/commands/change.js +243 -0
- package/cli/dist/commands/change.js.map +1 -0
- package/cli/dist/commands/clean.d.ts +15 -0
- package/cli/dist/commands/clean.d.ts.map +1 -0
- package/cli/dist/commands/clean.js +63 -0
- package/cli/dist/commands/clean.js.map +1 -0
- package/cli/dist/commands/clone.d.ts +15 -0
- package/cli/dist/commands/clone.d.ts.map +1 -0
- package/cli/dist/commands/clone.js +49 -0
- package/cli/dist/commands/clone.js.map +1 -0
- package/cli/dist/commands/config.d.ts +33 -0
- package/cli/dist/commands/config.d.ts.map +1 -0
- package/cli/dist/commands/config.js +166 -0
- package/cli/dist/commands/config.js.map +1 -0
- package/cli/dist/commands/context.d.ts +38 -0
- package/cli/dist/commands/context.d.ts.map +1 -0
- package/cli/dist/commands/context.js +205 -0
- package/cli/dist/commands/context.js.map +1 -0
- package/cli/dist/commands/create.d.ts +18 -0
- package/cli/dist/commands/create.d.ts.map +1 -0
- package/cli/dist/commands/create.js +178 -0
- package/cli/dist/commands/create.js.map +1 -0
- package/cli/dist/commands/diff.d.ts +19 -0
- package/cli/dist/commands/diff.d.ts.map +1 -0
- package/cli/dist/commands/diff.js +104 -0
- package/cli/dist/commands/diff.js.map +1 -0
- package/cli/dist/commands/doctor.d.ts +14 -0
- package/cli/dist/commands/doctor.d.ts.map +1 -0
- package/cli/dist/commands/doctor.js +62 -0
- package/cli/dist/commands/doctor.js.map +1 -0
- package/cli/dist/commands/export.d.ts +28 -0
- package/cli/dist/commands/export.d.ts.map +1 -0
- package/cli/dist/commands/export.js +135 -0
- package/cli/dist/commands/export.js.map +1 -0
- package/cli/dist/commands/import.d.ts +23 -0
- package/cli/dist/commands/import.d.ts.map +1 -0
- package/cli/dist/commands/import.js +118 -0
- package/cli/dist/commands/import.js.map +1 -0
- package/cli/dist/commands/prompt.d.ts +45 -0
- package/cli/dist/commands/prompt.d.ts.map +1 -0
- package/cli/dist/commands/prompt.js +223 -0
- package/cli/dist/commands/prompt.js.map +1 -0
- package/cli/dist/commands/spec.d.ts +57 -0
- package/cli/dist/commands/spec.d.ts.map +1 -0
- package/cli/dist/commands/spec.js +279 -0
- package/cli/dist/commands/spec.js.map +1 -0
- package/cli/dist/commands/stats.d.ts +18 -0
- package/cli/dist/commands/stats.d.ts.map +1 -0
- package/cli/dist/commands/stats.js +85 -0
- package/cli/dist/commands/stats.js.map +1 -0
- package/cli/dist/commands/task.d.ts +65 -0
- package/cli/dist/commands/task.d.ts.map +1 -0
- package/cli/dist/commands/task.js +282 -0
- package/cli/dist/commands/task.js.map +1 -0
- package/cli/dist/commands/template.d.ts +17 -0
- package/cli/dist/commands/template.d.ts.map +1 -0
- package/cli/dist/commands/template.js +55 -0
- package/cli/dist/commands/template.js.map +1 -0
- package/cli/dist/utils/agent-config.d.ts +129 -0
- package/cli/dist/utils/agent-config.d.ts.map +1 -0
- package/cli/dist/utils/agent-config.js +297 -0
- package/cli/dist/utils/agent-config.js.map +1 -0
- package/cli/dist/utils/auto-sync.js +19 -19
- package/cli/dist/utils/beads-graph.d.ts +17 -0
- package/cli/dist/utils/beads-graph.d.ts.map +1 -0
- package/cli/dist/utils/beads-graph.js +150 -0
- package/cli/dist/utils/beads-graph.js.map +1 -0
- package/cli/dist/utils/beads-integration.d.ts +112 -0
- package/cli/dist/utils/beads-integration.d.ts.map +1 -0
- package/cli/dist/utils/beads-integration.js +312 -0
- package/cli/dist/utils/beads-integration.js.map +1 -0
- package/cli/dist/utils/beads-reporter.d.ts +17 -0
- package/cli/dist/utils/beads-reporter.d.ts.map +1 -0
- package/cli/dist/utils/beads-reporter.js +160 -0
- package/cli/dist/utils/beads-reporter.js.map +1 -0
- package/cli/dist/utils/cache-manager.d.ts +55 -0
- package/cli/dist/utils/cache-manager.d.ts.map +1 -0
- package/cli/dist/utils/cache-manager.js +150 -0
- package/cli/dist/utils/cache-manager.js.map +1 -0
- package/cli/dist/utils/change-manager.d.ts +70 -0
- package/cli/dist/utils/change-manager.d.ts.map +1 -0
- package/cli/dist/utils/change-manager.js +412 -0
- package/cli/dist/utils/change-manager.js.map +1 -0
- package/cli/dist/utils/config-manager-enhanced.d.ts +66 -0
- package/cli/dist/utils/config-manager-enhanced.d.ts.map +1 -0
- package/cli/dist/utils/config-manager-enhanced.js +77 -0
- package/cli/dist/utils/config-manager-enhanced.js.map +1 -0
- package/cli/dist/utils/context-manager.d.ts +96 -0
- package/cli/dist/utils/context-manager.d.ts.map +1 -0
- package/cli/dist/utils/context-manager.js +258 -0
- package/cli/dist/utils/context-manager.js.map +1 -0
- package/cli/dist/utils/diff-engine.d.ts +78 -0
- package/cli/dist/utils/diff-engine.d.ts.map +1 -0
- package/cli/dist/utils/diff-engine.js +233 -0
- package/cli/dist/utils/diff-engine.js.map +1 -0
- package/cli/dist/utils/export-system.d.ts +101 -0
- package/cli/dist/utils/export-system.d.ts.map +1 -0
- package/cli/dist/utils/export-system.js +289 -0
- package/cli/dist/utils/export-system.js.map +1 -0
- package/cli/dist/utils/health-checker.d.ts +66 -0
- package/cli/dist/utils/health-checker.d.ts.map +1 -0
- package/cli/dist/utils/health-checker.js +285 -0
- package/cli/dist/utils/health-checker.js.map +1 -0
- package/cli/dist/utils/import-system.d.ts +74 -0
- package/cli/dist/utils/import-system.d.ts.map +1 -0
- package/cli/dist/utils/import-system.js +317 -0
- package/cli/dist/utils/import-system.js.map +1 -0
- package/cli/dist/utils/module-cloner.d.ts +40 -0
- package/cli/dist/utils/module-cloner.d.ts.map +1 -0
- package/cli/dist/utils/module-cloner.js +136 -0
- package/cli/dist/utils/module-cloner.js.map +1 -0
- package/cli/dist/utils/prompt-manager.d.ts +90 -0
- package/cli/dist/utils/prompt-manager.d.ts.map +1 -0
- package/cli/dist/utils/prompt-manager.js +302 -0
- package/cli/dist/utils/prompt-manager.js.map +1 -0
- package/cli/dist/utils/spec-manager.d.ts +65 -0
- package/cli/dist/utils/spec-manager.d.ts.map +1 -0
- package/cli/dist/utils/spec-manager.js +329 -0
- package/cli/dist/utils/spec-manager.js.map +1 -0
- package/cli/dist/utils/stats-collector.d.ts +74 -0
- package/cli/dist/utils/stats-collector.d.ts.map +1 -0
- package/cli/dist/utils/stats-collector.js +164 -0
- package/cli/dist/utils/stats-collector.js.map +1 -0
- package/cli/dist/utils/template-engine.d.ts +47 -0
- package/cli/dist/utils/template-engine.d.ts.map +1 -0
- package/cli/dist/utils/template-engine.js +204 -0
- package/cli/dist/utils/template-engine.js.map +1 -0
- package/package.json +12 -3
- package/augment-extensions/workflows/openspec/README.md +0 -96
- package/augment-extensions/workflows/openspec/examples/complete-change-example.md +0 -244
- package/augment-extensions/workflows/openspec/module.json +0 -54
- package/augment-extensions/workflows/openspec/rules/best-practices.md +0 -272
- package/augment-extensions/workflows/openspec/rules/manual-setup.md +0 -231
- package/augment-extensions/workflows/openspec/rules/spec-format.md +0 -236
- package/augment-extensions/workflows/openspec/rules/workflow.md +0 -214
- package/cli/dist/utils/__tests__/adr-validator.example.d.ts +0 -6
- package/cli/dist/utils/__tests__/adr-validator.example.d.ts.map +0 -1
- package/cli/dist/utils/__tests__/adr-validator.example.js +0 -148
- package/cli/dist/utils/__tests__/adr-validator.example.js.map +0 -1
- package/cli/dist/utils/adr-validator.d.ts +0 -65
- package/cli/dist/utils/adr-validator.d.ts.map +0 -1
- package/cli/dist/utils/adr-validator.js +0 -203
- package/cli/dist/utils/adr-validator.js.map +0 -1
|
@@ -1,119 +1,119 @@
|
|
|
1
|
-
# Visual Design Module Tests
|
|
2
|
-
|
|
3
|
-
Comprehensive unit and integration tests for the Visual Design module.
|
|
4
|
-
|
|
5
|
-
## Test Files
|
|
6
|
-
|
|
7
|
-
### `style-selector.test.ts`
|
|
8
|
-
Tests for the style selector module, including:
|
|
9
|
-
- Default vendor priority chain (google → microsoft → amazon)
|
|
10
|
-
- Custom priority configuration
|
|
11
|
-
- Vendor preference handling
|
|
12
|
-
- Fallback logic
|
|
13
|
-
- Case-insensitive vendor matching
|
|
14
|
-
- Helper functions (getVendorStyle, hasVendorStyle, getAllVendorStyles)
|
|
15
|
-
|
|
16
|
-
### `vendor-styles.test.ts`
|
|
17
|
-
Integration tests for all vendor design systems:
|
|
18
|
-
- **Google Modern (Material 3 Expressive)**: Color palette, typography, layout, motion, elevation, components
|
|
19
|
-
- **Microsoft Fluent 2**: Color palette, typography, layout, motion, elevation, components
|
|
20
|
-
- **Amazon Cloudscape**: Color palette, typography, layout, motion, elevation, components
|
|
21
|
-
- **Cross-vendor consistency**: Ensures all vendors implement required properties
|
|
22
|
-
|
|
23
|
-
## Running Tests
|
|
24
|
-
|
|
25
|
-
### Prerequisites
|
|
26
|
-
```bash
|
|
27
|
-
npm install --save-dev jest @types/jest ts-jest
|
|
28
|
-
```
|
|
29
|
-
|
|
30
|
-
### Run All Tests
|
|
31
|
-
```bash
|
|
32
|
-
npm test
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
### Run Specific Test File
|
|
36
|
-
```bash
|
|
37
|
-
npm test style-selector.test.ts
|
|
38
|
-
npm test vendor-styles.test.ts
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
### Run with Coverage
|
|
42
|
-
```bash
|
|
43
|
-
npm test -- --coverage
|
|
44
|
-
```
|
|
45
|
-
|
|
46
|
-
## Test Coverage
|
|
47
|
-
|
|
48
|
-
The test suite covers:
|
|
49
|
-
- ✅ Style selector creation and configuration
|
|
50
|
-
- ✅ Default vendor priority chain
|
|
51
|
-
- ✅ Custom vendor priority chains
|
|
52
|
-
- ✅ Vendor preference handling
|
|
53
|
-
- ✅ Fallback logic for invalid vendors
|
|
54
|
-
- ✅ Case-insensitive vendor matching
|
|
55
|
-
- ✅ All vendor style implementations
|
|
56
|
-
- ✅ Cross-vendor consistency checks
|
|
57
|
-
- ✅ Required properties validation
|
|
58
|
-
- ✅ Accessibility standards validation
|
|
59
|
-
- ✅ Responsive grid systems
|
|
60
|
-
- ✅ Spacing systems
|
|
61
|
-
|
|
62
|
-
## Expected Test Results
|
|
63
|
-
|
|
64
|
-
All tests should pass with 100% coverage of:
|
|
65
|
-
- `style-selector.ts`
|
|
66
|
-
- `domains/web-page-styles/google-modern.ts`
|
|
67
|
-
- `domains/web-page-styles/microsoft-fluent.ts`
|
|
68
|
-
- `domains/web-page-styles/amazon-cloudscape.ts`
|
|
69
|
-
|
|
70
|
-
## Adding New Tests
|
|
71
|
-
|
|
72
|
-
When adding new vendor styles or features:
|
|
73
|
-
|
|
74
|
-
1. **Add vendor style tests** in `vendor-styles.test.ts`:
|
|
75
|
-
```typescript
|
|
76
|
-
describe('New Vendor Style', () => {
|
|
77
|
-
it('should have correct vendor identifier', () => {
|
|
78
|
-
expect(NEW_VENDOR.vendor).toBe('vendor-name');
|
|
79
|
-
});
|
|
80
|
-
// Add more tests...
|
|
81
|
-
});
|
|
82
|
-
```
|
|
83
|
-
|
|
84
|
-
2. **Update style selector tests** in `style-selector.test.ts`:
|
|
85
|
-
```typescript
|
|
86
|
-
it('should select new vendor when specified', () => {
|
|
87
|
-
const style = selectVendorStyle({ vendor: 'new-vendor' });
|
|
88
|
-
expect(style).toBe(NEW_VENDOR);
|
|
89
|
-
});
|
|
90
|
-
```
|
|
91
|
-
|
|
92
|
-
3. **Update cross-vendor tests** to include the new vendor in the array.
|
|
93
|
-
|
|
94
|
-
## Continuous Integration
|
|
95
|
-
|
|
96
|
-
These tests are designed to run in CI/CD pipelines:
|
|
97
|
-
- Fast execution (< 5 seconds)
|
|
98
|
-
- No external dependencies
|
|
99
|
-
- Deterministic results
|
|
100
|
-
- Clear error messages
|
|
101
|
-
|
|
102
|
-
## Troubleshooting
|
|
103
|
-
|
|
104
|
-
### Import Errors
|
|
105
|
-
If you encounter import errors, ensure:
|
|
106
|
-
- TypeScript is configured correctly (`tsconfig.json`)
|
|
107
|
-
- All dependencies are installed
|
|
108
|
-
- File paths are correct
|
|
109
|
-
|
|
110
|
-
### Type Errors
|
|
111
|
-
If you encounter type errors:
|
|
112
|
-
- Check that `types.ts` exports all required interfaces
|
|
113
|
-
- Verify vendor style implementations match the `VendorStyle` interface
|
|
114
|
-
- Ensure test files import types correctly
|
|
115
|
-
|
|
116
|
-
## License
|
|
117
|
-
|
|
118
|
-
Part of Augment Extensions. See repository root for license information.
|
|
119
|
-
|
|
1
|
+
# Visual Design Module Tests
|
|
2
|
+
|
|
3
|
+
Comprehensive unit and integration tests for the Visual Design module.
|
|
4
|
+
|
|
5
|
+
## Test Files
|
|
6
|
+
|
|
7
|
+
### `style-selector.test.ts`
|
|
8
|
+
Tests for the style selector module, including:
|
|
9
|
+
- Default vendor priority chain (google → microsoft → amazon)
|
|
10
|
+
- Custom priority configuration
|
|
11
|
+
- Vendor preference handling
|
|
12
|
+
- Fallback logic
|
|
13
|
+
- Case-insensitive vendor matching
|
|
14
|
+
- Helper functions (getVendorStyle, hasVendorStyle, getAllVendorStyles)
|
|
15
|
+
|
|
16
|
+
### `vendor-styles.test.ts`
|
|
17
|
+
Integration tests for all vendor design systems:
|
|
18
|
+
- **Google Modern (Material 3 Expressive)**: Color palette, typography, layout, motion, elevation, components
|
|
19
|
+
- **Microsoft Fluent 2**: Color palette, typography, layout, motion, elevation, components
|
|
20
|
+
- **Amazon Cloudscape**: Color palette, typography, layout, motion, elevation, components
|
|
21
|
+
- **Cross-vendor consistency**: Ensures all vendors implement required properties
|
|
22
|
+
|
|
23
|
+
## Running Tests
|
|
24
|
+
|
|
25
|
+
### Prerequisites
|
|
26
|
+
```bash
|
|
27
|
+
npm install --save-dev jest @types/jest ts-jest
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
### Run All Tests
|
|
31
|
+
```bash
|
|
32
|
+
npm test
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
### Run Specific Test File
|
|
36
|
+
```bash
|
|
37
|
+
npm test style-selector.test.ts
|
|
38
|
+
npm test vendor-styles.test.ts
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
### Run with Coverage
|
|
42
|
+
```bash
|
|
43
|
+
npm test -- --coverage
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## Test Coverage
|
|
47
|
+
|
|
48
|
+
The test suite covers:
|
|
49
|
+
- ✅ Style selector creation and configuration
|
|
50
|
+
- ✅ Default vendor priority chain
|
|
51
|
+
- ✅ Custom vendor priority chains
|
|
52
|
+
- ✅ Vendor preference handling
|
|
53
|
+
- ✅ Fallback logic for invalid vendors
|
|
54
|
+
- ✅ Case-insensitive vendor matching
|
|
55
|
+
- ✅ All vendor style implementations
|
|
56
|
+
- ✅ Cross-vendor consistency checks
|
|
57
|
+
- ✅ Required properties validation
|
|
58
|
+
- ✅ Accessibility standards validation
|
|
59
|
+
- ✅ Responsive grid systems
|
|
60
|
+
- ✅ Spacing systems
|
|
61
|
+
|
|
62
|
+
## Expected Test Results
|
|
63
|
+
|
|
64
|
+
All tests should pass with 100% coverage of:
|
|
65
|
+
- `style-selector.ts`
|
|
66
|
+
- `domains/web-page-styles/google-modern.ts`
|
|
67
|
+
- `domains/web-page-styles/microsoft-fluent.ts`
|
|
68
|
+
- `domains/web-page-styles/amazon-cloudscape.ts`
|
|
69
|
+
|
|
70
|
+
## Adding New Tests
|
|
71
|
+
|
|
72
|
+
When adding new vendor styles or features:
|
|
73
|
+
|
|
74
|
+
1. **Add vendor style tests** in `vendor-styles.test.ts`:
|
|
75
|
+
```typescript
|
|
76
|
+
describe('New Vendor Style', () => {
|
|
77
|
+
it('should have correct vendor identifier', () => {
|
|
78
|
+
expect(NEW_VENDOR.vendor).toBe('vendor-name');
|
|
79
|
+
});
|
|
80
|
+
// Add more tests...
|
|
81
|
+
});
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
2. **Update style selector tests** in `style-selector.test.ts`:
|
|
85
|
+
```typescript
|
|
86
|
+
it('should select new vendor when specified', () => {
|
|
87
|
+
const style = selectVendorStyle({ vendor: 'new-vendor' });
|
|
88
|
+
expect(style).toBe(NEW_VENDOR);
|
|
89
|
+
});
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
3. **Update cross-vendor tests** to include the new vendor in the array.
|
|
93
|
+
|
|
94
|
+
## Continuous Integration
|
|
95
|
+
|
|
96
|
+
These tests are designed to run in CI/CD pipelines:
|
|
97
|
+
- Fast execution (< 5 seconds)
|
|
98
|
+
- No external dependencies
|
|
99
|
+
- Deterministic results
|
|
100
|
+
- Clear error messages
|
|
101
|
+
|
|
102
|
+
## Troubleshooting
|
|
103
|
+
|
|
104
|
+
### Import Errors
|
|
105
|
+
If you encounter import errors, ensure:
|
|
106
|
+
- TypeScript is configured correctly (`tsconfig.json`)
|
|
107
|
+
- All dependencies are installed
|
|
108
|
+
- File paths are correct
|
|
109
|
+
|
|
110
|
+
### Type Errors
|
|
111
|
+
If you encounter type errors:
|
|
112
|
+
- Check that `types.ts` exports all required interfaces
|
|
113
|
+
- Verify vendor style implementations match the `VendorStyle` interface
|
|
114
|
+
- Ensure test files import types correctly
|
|
115
|
+
|
|
116
|
+
## License
|
|
117
|
+
|
|
118
|
+
Part of Augment Extensions. See repository root for license information.
|
|
119
|
+
|
|
@@ -1,172 +1,172 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Style Selector Tests
|
|
3
|
-
*
|
|
4
|
-
* Comprehensive unit and integration tests for the style selector module,
|
|
5
|
-
* including vendor priority, fallback logic, and preference handling.
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
import {
|
|
9
|
-
createStyleSelector,
|
|
10
|
-
defaultStyleSelector,
|
|
11
|
-
selectVendorStyle,
|
|
12
|
-
getVendorStyle,
|
|
13
|
-
getAllVendorStyles,
|
|
14
|
-
hasVendorStyle,
|
|
15
|
-
DEFAULT_VENDOR_PRIORITY
|
|
16
|
-
} from '../style-selector';
|
|
17
|
-
import { GOOGLE_MODERN } from '../domains/web-page-styles/google-modern';
|
|
18
|
-
import { MICROSOFT_FLUENT } from '../domains/web-page-styles/microsoft-fluent';
|
|
19
|
-
import { AMAZON_CLOUDSCAPE } from '../domains/web-page-styles/amazon-cloudscape';
|
|
20
|
-
|
|
21
|
-
describe('Style Selector', () => {
|
|
22
|
-
describe('DEFAULT_VENDOR_PRIORITY', () => {
|
|
23
|
-
it('should have correct default priority order', () => {
|
|
24
|
-
expect(DEFAULT_VENDOR_PRIORITY).toEqual(['google', 'microsoft', 'amazon']);
|
|
25
|
-
});
|
|
26
|
-
});
|
|
27
|
-
|
|
28
|
-
describe('createStyleSelector', () => {
|
|
29
|
-
it('should create selector with default priority', () => {
|
|
30
|
-
const selector = createStyleSelector();
|
|
31
|
-
expect(selector.vendorPriority).toEqual(['google', 'microsoft', 'amazon']);
|
|
32
|
-
expect(selector.fallbackChain).toEqual(['google', 'microsoft', 'amazon']);
|
|
33
|
-
});
|
|
34
|
-
|
|
35
|
-
it('should create selector with custom priority', () => {
|
|
36
|
-
const customPriority = ['amazon', 'microsoft', 'google'];
|
|
37
|
-
const selector = createStyleSelector(customPriority);
|
|
38
|
-
expect(selector.vendorPriority).toEqual(customPriority);
|
|
39
|
-
expect(selector.fallbackChain).toEqual(customPriority);
|
|
40
|
-
});
|
|
41
|
-
});
|
|
42
|
-
|
|
43
|
-
describe('defaultStyleSelector', () => {
|
|
44
|
-
it('should be initialized with default priority', () => {
|
|
45
|
-
expect(defaultStyleSelector.vendorPriority).toEqual(['google', 'microsoft', 'amazon']);
|
|
46
|
-
});
|
|
47
|
-
|
|
48
|
-
it('should select Google Modern by default', () => {
|
|
49
|
-
const style = defaultStyleSelector.selectStyle();
|
|
50
|
-
expect(style).toBe(GOOGLE_MODERN);
|
|
51
|
-
expect(style.vendor).toBe('google');
|
|
52
|
-
});
|
|
53
|
-
});
|
|
54
|
-
|
|
55
|
-
describe('selectStyle with preferences', () => {
|
|
56
|
-
it('should select Google Modern when vendor is "google"', () => {
|
|
57
|
-
const style = defaultStyleSelector.selectStyle({ vendor: 'google' });
|
|
58
|
-
expect(style).toBe(GOOGLE_MODERN);
|
|
59
|
-
expect(style.vendor).toBe('google');
|
|
60
|
-
});
|
|
61
|
-
|
|
62
|
-
it('should select Microsoft Fluent when vendor is "microsoft"', () => {
|
|
63
|
-
const style = defaultStyleSelector.selectStyle({ vendor: 'microsoft' });
|
|
64
|
-
expect(style).toBe(MICROSOFT_FLUENT);
|
|
65
|
-
expect(style.vendor).toBe('microsoft');
|
|
66
|
-
});
|
|
67
|
-
|
|
68
|
-
it('should select Amazon Cloudscape when vendor is "amazon"', () => {
|
|
69
|
-
const style = defaultStyleSelector.selectStyle({ vendor: 'amazon' });
|
|
70
|
-
expect(style).toBe(AMAZON_CLOUDSCAPE);
|
|
71
|
-
expect(style.vendor).toBe('amazon');
|
|
72
|
-
});
|
|
73
|
-
|
|
74
|
-
it('should be case-insensitive for vendor names', () => {
|
|
75
|
-
const styleUpper = defaultStyleSelector.selectStyle({ vendor: 'GOOGLE' });
|
|
76
|
-
const styleMixed = defaultStyleSelector.selectStyle({ vendor: 'GoOgLe' });
|
|
77
|
-
expect(styleUpper).toBe(GOOGLE_MODERN);
|
|
78
|
-
expect(styleMixed).toBe(GOOGLE_MODERN);
|
|
79
|
-
});
|
|
80
|
-
|
|
81
|
-
it('should fallback to priority chain for invalid vendor', () => {
|
|
82
|
-
const style = defaultStyleSelector.selectStyle({ vendor: 'invalid' });
|
|
83
|
-
expect(style).toBe(GOOGLE_MODERN); // First in default priority
|
|
84
|
-
});
|
|
85
|
-
|
|
86
|
-
it('should fallback to Google Modern when no vendor matches', () => {
|
|
87
|
-
const selector = createStyleSelector(['nonexistent']);
|
|
88
|
-
const style = selector.selectStyle();
|
|
89
|
-
expect(style).toBe(GOOGLE_MODERN);
|
|
90
|
-
});
|
|
91
|
-
});
|
|
92
|
-
|
|
93
|
-
describe('selectStyle with custom priority', () => {
|
|
94
|
-
it('should respect custom priority order', () => {
|
|
95
|
-
const selector = createStyleSelector(['amazon', 'microsoft', 'google']);
|
|
96
|
-
const style = selector.selectStyle();
|
|
97
|
-
expect(style).toBe(AMAZON_CLOUDSCAPE);
|
|
98
|
-
});
|
|
99
|
-
|
|
100
|
-
it('should fallback through custom chain', () => {
|
|
101
|
-
const selector = createStyleSelector(['invalid1', 'microsoft', 'google']);
|
|
102
|
-
const style = selector.selectStyle();
|
|
103
|
-
expect(style).toBe(MICROSOFT_FLUENT);
|
|
104
|
-
});
|
|
105
|
-
});
|
|
106
|
-
|
|
107
|
-
describe('selectVendorStyle', () => {
|
|
108
|
-
it('should select Google Modern by default', () => {
|
|
109
|
-
const style = selectVendorStyle();
|
|
110
|
-
expect(style).toBe(GOOGLE_MODERN);
|
|
111
|
-
});
|
|
112
|
-
|
|
113
|
-
it('should respect vendor preference', () => {
|
|
114
|
-
const style = selectVendorStyle({ vendor: 'microsoft' });
|
|
115
|
-
expect(style).toBe(MICROSOFT_FLUENT);
|
|
116
|
-
});
|
|
117
|
-
});
|
|
118
|
-
|
|
119
|
-
describe('getVendorStyle', () => {
|
|
120
|
-
it('should return Google Modern for "google"', () => {
|
|
121
|
-
expect(getVendorStyle('google')).toBe(GOOGLE_MODERN);
|
|
122
|
-
});
|
|
123
|
-
|
|
124
|
-
it('should return Microsoft Fluent for "microsoft"', () => {
|
|
125
|
-
expect(getVendorStyle('microsoft')).toBe(MICROSOFT_FLUENT);
|
|
126
|
-
});
|
|
127
|
-
|
|
128
|
-
it('should return Amazon Cloudscape for "amazon"', () => {
|
|
129
|
-
expect(getVendorStyle('amazon')).toBe(AMAZON_CLOUDSCAPE);
|
|
130
|
-
});
|
|
131
|
-
|
|
132
|
-
it('should return undefined for invalid vendor', () => {
|
|
133
|
-
expect(getVendorStyle('invalid')).toBeUndefined();
|
|
134
|
-
});
|
|
135
|
-
|
|
136
|
-
it('should be case-insensitive', () => {
|
|
137
|
-
expect(getVendorStyle('GOOGLE')).toBe(GOOGLE_MODERN);
|
|
138
|
-
expect(getVendorStyle('MicroSoft')).toBe(MICROSOFT_FLUENT);
|
|
139
|
-
});
|
|
140
|
-
});
|
|
141
|
-
|
|
142
|
-
describe('getAllVendorStyles', () => {
|
|
143
|
-
it('should return all three vendor styles', () => {
|
|
144
|
-
const styles = getAllVendorStyles();
|
|
145
|
-
expect(styles).toHaveLength(3);
|
|
146
|
-
expect(styles).toContain(GOOGLE_MODERN);
|
|
147
|
-
expect(styles).toContain(MICROSOFT_FLUENT);
|
|
148
|
-
expect(styles).toContain(AMAZON_CLOUDSCAPE);
|
|
149
|
-
});
|
|
150
|
-
});
|
|
151
|
-
|
|
152
|
-
describe('hasVendorStyle', () => {
|
|
153
|
-
it('should return true for valid vendors', () => {
|
|
154
|
-
expect(hasVendorStyle('google')).toBe(true);
|
|
155
|
-
expect(hasVendorStyle('microsoft')).toBe(true);
|
|
156
|
-
expect(hasVendorStyle('amazon')).toBe(true);
|
|
157
|
-
});
|
|
158
|
-
|
|
159
|
-
it('should return false for invalid vendors', () => {
|
|
160
|
-
expect(hasVendorStyle('invalid')).toBe(false);
|
|
161
|
-
expect(hasVendorStyle('apple')).toBe(false);
|
|
162
|
-
expect(hasVendorStyle('')).toBe(false);
|
|
163
|
-
});
|
|
164
|
-
|
|
165
|
-
it('should be case-insensitive', () => {
|
|
166
|
-
expect(hasVendorStyle('GOOGLE')).toBe(true);
|
|
167
|
-
expect(hasVendorStyle('MicroSoft')).toBe(true);
|
|
168
|
-
expect(hasVendorStyle('AMAZON')).toBe(true);
|
|
169
|
-
});
|
|
170
|
-
});
|
|
171
|
-
});
|
|
172
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Style Selector Tests
|
|
3
|
+
*
|
|
4
|
+
* Comprehensive unit and integration tests for the style selector module,
|
|
5
|
+
* including vendor priority, fallback logic, and preference handling.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import {
|
|
9
|
+
createStyleSelector,
|
|
10
|
+
defaultStyleSelector,
|
|
11
|
+
selectVendorStyle,
|
|
12
|
+
getVendorStyle,
|
|
13
|
+
getAllVendorStyles,
|
|
14
|
+
hasVendorStyle,
|
|
15
|
+
DEFAULT_VENDOR_PRIORITY
|
|
16
|
+
} from '../style-selector';
|
|
17
|
+
import { GOOGLE_MODERN } from '../domains/web-page-styles/google-modern';
|
|
18
|
+
import { MICROSOFT_FLUENT } from '../domains/web-page-styles/microsoft-fluent';
|
|
19
|
+
import { AMAZON_CLOUDSCAPE } from '../domains/web-page-styles/amazon-cloudscape';
|
|
20
|
+
|
|
21
|
+
describe('Style Selector', () => {
|
|
22
|
+
describe('DEFAULT_VENDOR_PRIORITY', () => {
|
|
23
|
+
it('should have correct default priority order', () => {
|
|
24
|
+
expect(DEFAULT_VENDOR_PRIORITY).toEqual(['google', 'microsoft', 'amazon']);
|
|
25
|
+
});
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
describe('createStyleSelector', () => {
|
|
29
|
+
it('should create selector with default priority', () => {
|
|
30
|
+
const selector = createStyleSelector();
|
|
31
|
+
expect(selector.vendorPriority).toEqual(['google', 'microsoft', 'amazon']);
|
|
32
|
+
expect(selector.fallbackChain).toEqual(['google', 'microsoft', 'amazon']);
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
it('should create selector with custom priority', () => {
|
|
36
|
+
const customPriority = ['amazon', 'microsoft', 'google'];
|
|
37
|
+
const selector = createStyleSelector(customPriority);
|
|
38
|
+
expect(selector.vendorPriority).toEqual(customPriority);
|
|
39
|
+
expect(selector.fallbackChain).toEqual(customPriority);
|
|
40
|
+
});
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
describe('defaultStyleSelector', () => {
|
|
44
|
+
it('should be initialized with default priority', () => {
|
|
45
|
+
expect(defaultStyleSelector.vendorPriority).toEqual(['google', 'microsoft', 'amazon']);
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
it('should select Google Modern by default', () => {
|
|
49
|
+
const style = defaultStyleSelector.selectStyle();
|
|
50
|
+
expect(style).toBe(GOOGLE_MODERN);
|
|
51
|
+
expect(style.vendor).toBe('google');
|
|
52
|
+
});
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
describe('selectStyle with preferences', () => {
|
|
56
|
+
it('should select Google Modern when vendor is "google"', () => {
|
|
57
|
+
const style = defaultStyleSelector.selectStyle({ vendor: 'google' });
|
|
58
|
+
expect(style).toBe(GOOGLE_MODERN);
|
|
59
|
+
expect(style.vendor).toBe('google');
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
it('should select Microsoft Fluent when vendor is "microsoft"', () => {
|
|
63
|
+
const style = defaultStyleSelector.selectStyle({ vendor: 'microsoft' });
|
|
64
|
+
expect(style).toBe(MICROSOFT_FLUENT);
|
|
65
|
+
expect(style.vendor).toBe('microsoft');
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
it('should select Amazon Cloudscape when vendor is "amazon"', () => {
|
|
69
|
+
const style = defaultStyleSelector.selectStyle({ vendor: 'amazon' });
|
|
70
|
+
expect(style).toBe(AMAZON_CLOUDSCAPE);
|
|
71
|
+
expect(style.vendor).toBe('amazon');
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
it('should be case-insensitive for vendor names', () => {
|
|
75
|
+
const styleUpper = defaultStyleSelector.selectStyle({ vendor: 'GOOGLE' });
|
|
76
|
+
const styleMixed = defaultStyleSelector.selectStyle({ vendor: 'GoOgLe' });
|
|
77
|
+
expect(styleUpper).toBe(GOOGLE_MODERN);
|
|
78
|
+
expect(styleMixed).toBe(GOOGLE_MODERN);
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
it('should fallback to priority chain for invalid vendor', () => {
|
|
82
|
+
const style = defaultStyleSelector.selectStyle({ vendor: 'invalid' });
|
|
83
|
+
expect(style).toBe(GOOGLE_MODERN); // First in default priority
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
it('should fallback to Google Modern when no vendor matches', () => {
|
|
87
|
+
const selector = createStyleSelector(['nonexistent']);
|
|
88
|
+
const style = selector.selectStyle();
|
|
89
|
+
expect(style).toBe(GOOGLE_MODERN);
|
|
90
|
+
});
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
describe('selectStyle with custom priority', () => {
|
|
94
|
+
it('should respect custom priority order', () => {
|
|
95
|
+
const selector = createStyleSelector(['amazon', 'microsoft', 'google']);
|
|
96
|
+
const style = selector.selectStyle();
|
|
97
|
+
expect(style).toBe(AMAZON_CLOUDSCAPE);
|
|
98
|
+
});
|
|
99
|
+
|
|
100
|
+
it('should fallback through custom chain', () => {
|
|
101
|
+
const selector = createStyleSelector(['invalid1', 'microsoft', 'google']);
|
|
102
|
+
const style = selector.selectStyle();
|
|
103
|
+
expect(style).toBe(MICROSOFT_FLUENT);
|
|
104
|
+
});
|
|
105
|
+
});
|
|
106
|
+
|
|
107
|
+
describe('selectVendorStyle', () => {
|
|
108
|
+
it('should select Google Modern by default', () => {
|
|
109
|
+
const style = selectVendorStyle();
|
|
110
|
+
expect(style).toBe(GOOGLE_MODERN);
|
|
111
|
+
});
|
|
112
|
+
|
|
113
|
+
it('should respect vendor preference', () => {
|
|
114
|
+
const style = selectVendorStyle({ vendor: 'microsoft' });
|
|
115
|
+
expect(style).toBe(MICROSOFT_FLUENT);
|
|
116
|
+
});
|
|
117
|
+
});
|
|
118
|
+
|
|
119
|
+
describe('getVendorStyle', () => {
|
|
120
|
+
it('should return Google Modern for "google"', () => {
|
|
121
|
+
expect(getVendorStyle('google')).toBe(GOOGLE_MODERN);
|
|
122
|
+
});
|
|
123
|
+
|
|
124
|
+
it('should return Microsoft Fluent for "microsoft"', () => {
|
|
125
|
+
expect(getVendorStyle('microsoft')).toBe(MICROSOFT_FLUENT);
|
|
126
|
+
});
|
|
127
|
+
|
|
128
|
+
it('should return Amazon Cloudscape for "amazon"', () => {
|
|
129
|
+
expect(getVendorStyle('amazon')).toBe(AMAZON_CLOUDSCAPE);
|
|
130
|
+
});
|
|
131
|
+
|
|
132
|
+
it('should return undefined for invalid vendor', () => {
|
|
133
|
+
expect(getVendorStyle('invalid')).toBeUndefined();
|
|
134
|
+
});
|
|
135
|
+
|
|
136
|
+
it('should be case-insensitive', () => {
|
|
137
|
+
expect(getVendorStyle('GOOGLE')).toBe(GOOGLE_MODERN);
|
|
138
|
+
expect(getVendorStyle('MicroSoft')).toBe(MICROSOFT_FLUENT);
|
|
139
|
+
});
|
|
140
|
+
});
|
|
141
|
+
|
|
142
|
+
describe('getAllVendorStyles', () => {
|
|
143
|
+
it('should return all three vendor styles', () => {
|
|
144
|
+
const styles = getAllVendorStyles();
|
|
145
|
+
expect(styles).toHaveLength(3);
|
|
146
|
+
expect(styles).toContain(GOOGLE_MODERN);
|
|
147
|
+
expect(styles).toContain(MICROSOFT_FLUENT);
|
|
148
|
+
expect(styles).toContain(AMAZON_CLOUDSCAPE);
|
|
149
|
+
});
|
|
150
|
+
});
|
|
151
|
+
|
|
152
|
+
describe('hasVendorStyle', () => {
|
|
153
|
+
it('should return true for valid vendors', () => {
|
|
154
|
+
expect(hasVendorStyle('google')).toBe(true);
|
|
155
|
+
expect(hasVendorStyle('microsoft')).toBe(true);
|
|
156
|
+
expect(hasVendorStyle('amazon')).toBe(true);
|
|
157
|
+
});
|
|
158
|
+
|
|
159
|
+
it('should return false for invalid vendors', () => {
|
|
160
|
+
expect(hasVendorStyle('invalid')).toBe(false);
|
|
161
|
+
expect(hasVendorStyle('apple')).toBe(false);
|
|
162
|
+
expect(hasVendorStyle('')).toBe(false);
|
|
163
|
+
});
|
|
164
|
+
|
|
165
|
+
it('should be case-insensitive', () => {
|
|
166
|
+
expect(hasVendorStyle('GOOGLE')).toBe(true);
|
|
167
|
+
expect(hasVendorStyle('MicroSoft')).toBe(true);
|
|
168
|
+
expect(hasVendorStyle('AMAZON')).toBe(true);
|
|
169
|
+
});
|
|
170
|
+
});
|
|
171
|
+
});
|
|
172
|
+
|