This module provides comprehensive validation checklists to ensure the widget is production-ready before deployment.
Purpose: Quality assurance and completeness verification
Use: After all code, tests, and documentation are complete
- Code Quality - Architecture, patterns, best practices
- Testing - Unit, hook, E2E tests
- Documentation - AGENTS.md, ARCHITECTURE.md completeness
- Integration - cc-widgets, sample apps
- Manual Testing - Real-world usage verification
- Widget → Hook → Component → Store → SDK pattern followed
- Widget component wrapped with
observerHOC - Widget wrapped with
ErrorBoundary - Hook contains all business logic
- Component is pure presentational (if separate component)
- No layer violations (Widget doesn't call SDK directly)
- No component accessing store directly
- Widget uses
observerHOC from mobx-react-lite - Store observables accessed correctly
- Store mutations wrapped in
runInAction - No direct store mutations outside runInAction
- No reactions created in render
- All types exported from types file
- Props interface fully documented with JSDoc
- No
anytypes used (proper types everywhere) - Optional props marked with
? - Default values documented
- Return types specified on functions
- Complex types have interfaces/types
- Exported types available to consumers
- Functional components used (not class components)
- Hooks used correctly (rules of hooks)
-
useCallbackfor event handlers -
useMemofor expensive computations -
useEffectdependencies correct -
useEffectcleanup functions present - Display names set for debugging
- Loading states handled
- Error states handled
- Empty states handled
- ErrorBoundary wraps widget
- Try-catch in all async operations
- Errors logged to console
-
onErrorcallback called on errors - User-friendly error messages displayed
- Error recovery possible
- No unhandled promise rejections
- Linting passes:
yarn test:styles - No console.log statements (use proper logging)
- Comments explain "why", not "what"
- Complex logic documented
- TODO comments removed
- Dead code removed
- Consistent naming conventions
- Widget wrapped with
withMetricsHOC in index.ts - NOT wrapped with
withMetricsin wc.ts - WIDGET_MOUNTED logged automatically
- WIDGET_UNMOUNTED logged automatically
- Custom metrics logged where appropriate
Verify that the widget actually WORKS as intended, not just that it compiles. Test the complete data flow from user action to UI update.
FIRST STEP: Load approved sequence diagrams from 01-pre-questions.md
Before running any tests, verify implementation matches approved diagrams:
- Load all sequence diagrams from pre-questions
- Load SDK API documentation from pre-questions
- Load data transformation mappings from pre-questions
Compare implemented code against approved sequence diagrams:
For each SDK method in sequence diagrams:
- Method exists in contact-centre-sdk-apis/contact-center.json
- Exact path matches sequence diagram (e.g.,
store.cc.someService.someMethod) - Parameters match diagram specification (type, order, values)
- Return type matches SDK documentation AND diagram
- Accessed via
store.cc.methodName()(not direct import) - Error handling present (try/catch) as per error flow diagram
- Success callbacks fire on success (verify timing per diagram)
- Error callbacks fire on error (verify error path per diagram)
- Response structure matches documented structure
Example Verification:
// From sequence diagram: store.cc.someService.someMethod(param1, param2)
// ✓ Exists in SDK JSON at exact path
// ✓ Parameters: (param1: value1, param2: value2) - matches diagram
// ✓ Return type: Promise<{statusCode: number, data: {...}}>
// ✓ Error handling: try/catch present with setError() call
// ✓ Callback: props.onSuccess?.(data) called on success
// ✓ Error callback: props.onError?.(error) called on failure
// ✓ Response accessed: response.data.items (matches diagram)If method not found in SDK or signature mismatch → RETURN to sequence diagrams and fix
Data Transformation Validation:
- Every transformation matches diagram mapping
- Source fields extracted correctly (e.g.,
session.other.name) - Fallback values match diagram (e.g.,
|| 'Unknown') - Type conversions correct (e.g., ISO string → timestamp)
- Optional field handling matches diagram (
?? operator)
Example:
// Diagram says: contactName = session.other.name || session.other.primaryDisplayString || 'Unknown'
// Code implements:
contactName: session.other?.name || session.other?.primaryDisplayString || 'Unknown'
// ✓ Matches diagramValidate implementation against sequence diagrams:
For EACH sequence diagram, manually test the flow:
- Load sequence diagram from pre-questions for scenario
- Perform user action shown in diagram
- Verify EACH step in diagram occurs in correct order
- Check state updates match diagram timing
- Confirm UI updates match diagram end state
Per diagram sequence:
- User clicks button → Event handler called? ✓
- Handler sets
isLoading=true→ State updated? ✓ - Handler sets
error=null→ State cleared? ✓ - Handler calls SDK method → Method invoked with correct params? ✓
- SDK returns response → Response structure matches diagram? ✓
- Handler transforms data → Transformation per diagram mappings? ✓
- Handler sets
data=records→ State updated with transformed data? ✓ - Handler sets
isLoading=false→ Loading state cleared? ✓ - Component re-renders → UI shows new data? ✓
If ANY step fails or order wrong → Debug against sequence diagram
For YOUR widget, test ALL diagram scenarios:
Scenario 1: (from sequence diagram: _______________)
Diagram step → Implemented code → Verified?
───────────────────────────────────────────
User action: _______________ → _______________ → [ ]
Handler called: _______________ → _______________ → [ ]
State update 1: _______________ → _______________ → [ ]
State update 2: _______________ → _______________ → [ ]
SDK call: _______________ → _______________ → [ ]
SDK response: _______________ → _______________ → [ ]
Data transform: _______________ → _______________ → [ ]
Final state: _______________ → _______________ → [ ]
UI renders: _______________ → _______________ → [ ]
Overall Status: [ ] VERIFIED [ ] FAILED
Scenario 2: (from sequence diagram: _______________)
Diagram step → Implemented code → Verified?
───────────────────────────────────────────
User action: _______________ → _______________ → [ ]
Handler called: _______________ → _______________ → [ ]
State update 1: _______________ → _______________ → [ ]
State update 2: _______________ → _______________ → [ ]
SDK call: _______________ → _______________ → [ ]
SDK response: _______________ → _______________ → [ ]
Data transform: _______________ → _______________ → [ ]
Final state: _______________ → _______________ → [ ]
UI renders: _______________ → _______________ → [ ]
Overall Status: [ ] VERIFIED [ ] FAILED
Scenario 3: (from sequence diagram: _______________)
Diagram step → Implemented code → Verified?
───────────────────────────────────────────
User action: _______________ → _______________ → [ ]
Handler called: _______________ → _______________ → [ ]
State update 1: _______________ → _______________ → [ ]
State update 2: _______________ → _______________ → [ ]
SDK call: _______________ → _______________ → [ ]
SDK response: _______________ → _______________ → [ ]
Data transform: _______________ → _______________ → [ ]
Final state: _______________ → _______________ → [ ]
UI renders: _______________ → _______________ → [ ]
Overall Status: [ ] VERIFIED [ ] FAILED
Trace data through ALL layers:
User Action (UI)
↓
Widget Handler (index.tsx)
↓
Hook Method (helper.ts)
↓
Store/SDK Call
↓
Response/Observable Update
↓
Hook State Update
↓
Component Props
↓
UI Render
Verification:
- User action triggers widget handler
- Widget handler calls hook method correctly
- Hook method accesses store/SDK correctly
- Response updates hook state
- Hook state passes to component props
- Component renders with updated props
- UI reflects the change
If any transition fails → Debug and fix
Check for circular dependencies:
# In widget code, search for cc-widgets import:
grep -r "from '@webex/cc-widgets'" packages/contact-center/{widget-name}/src/
# Expected: NO MATCHES
# In cc-components, search for widget imports:
grep -r "from '@webex/cc-.*-widget'" packages/contact-center/cc-components/src/
# Expected: NO MATCHESValidation:
- No matches for
@webex/cc-widgetsin widget code - No matches for widget packages in cc-components
- All imports follow one-directional flow
- No circular dependencies detected
If any matches found → Refactor imports
Compare with design input (Figma/screenshot/spec):
- Colors match design (or use Momentum tokens)
- Spacing matches (8px/0.5rem grid adhered)
- Layout matches (flex/grid structure correct)
- Components match design (correct Momentum components used)
- Typography matches (sizes, weights correct)
- Interactions work (hover, active, focus states)
- Theme switching works (light/dark modes)
Visual differences found:
| Element | Design | Generated | Status | Notes |
|---|---|---|---|---|
| _____ | _____ | _____ | [ ] Fixed | _____ |
| _____ | _____ | _____ | [ ] Fixed | _____ |
| _____ | _____ | _____ | [ ] Fixed | _____ |
If visual mismatch → Update styling
# Build the widget
yarn build
# Expected: NO ERRORSCommon compiler errors and fixes:
| Error | Cause | Fix |
|---|---|---|
| Type error | Missing/incorrect types | Add proper type definitions |
| Import error | Wrong path or missing export | Check paths and exports |
| Circular dependency | Improper imports | Refactor to follow dependency flow |
| Syntax error | Code syntax issue | Fix syntax |
Validation:
-
yarn buildcompletes without errors - No TypeScript errors
- No import errors
- No syntax errors
- Bundle size reasonable
Fix ALL compiler errors before completing
Run sample app and test widget:
# Start React sample app
yarn samples:serve-reactTest checklist:
- Widget renders without errors
- All buttons work
- All inputs work
- All dropdowns/selects work
- Callbacks fire correctly
- State updates reflect in UI immediately
- Error scenarios handled gracefully
- No console errors or warnings
Test scenarios:
-
Happy Path:
- Primary user flow works end-to-end
- UI updates correctly
- Callbacks fire with correct data
-
Error Scenarios:
- Invalid input shows error message
- API errors handled gracefully
- Error callbacks fire
- User can recover from errors
-
Edge Cases:
- Empty state handled
- Loading state shown
- No data scenario handled
- Rapid clicks handled
If runtime errors → Debug and fix
- Widget renders without crashing
- Renders with required props only
- Renders with all props
- All required props tested
- All optional props tested
- Default values tested
- Custom className applied
- Custom styles applied
- All callbacks tested (called correctly)
- Callbacks work when undefined
- Loading state tested
- Error state tested
- Empty/no-data state tested
- User interactions tested (clicks, inputs, etc.)
- Store integration tested
- SDK calls tested
- Edge cases tested
- Snapshot test included
- Hook initializes correctly
- Initial data fetch tested
- Initialization errors handled
- All handlers tested (success cases)
- All handlers tested (error cases)
- Callbacks called correctly
- Cleanup functions tested
- Subscriptions unsubscribed
- Dependency changes tested
- Re-initialization tested
- All tests pass:
yarn test:unit - Test coverage > 80%
- No skipped tests (.skip removed)
- No focused tests (.only removed)
- Tests are deterministic (not flaky)
- Tests are independent (can run in any order)
- Mock setup/teardown correct
- No console warnings during tests
- No console errors during tests
- Widget renders in sample app
- User interactions work end-to-end
- Error scenarios tested
- Toggle on/off works
- Multi-widget scenarios tested
- Overview section complete
- Package name stated
- Version references package.json
- Purpose clearly explained
- 3-5 key capabilities listed
- 4-6 usage examples provided
- Basic usage example (React)
- Web Component usage example
- Common use case examples
- Error handling example
- Dependencies documented
- Dependencies reference package.json (no hardcoded versions)
- Props API table complete
- All props documented
- Required/optional marked
- Default values shown
- Installation instructions included
- Link to ARCHITECTURE.md at END (token optimization)
- Component overview complete
- Component table has all components
- File structure documented
- Layer communication diagram (Mermaid)
- 3-5 sequence diagrams (Mermaid)
- All diagrams use Mermaid (not PlantUML)
- Diagrams render correctly
- Hook/business logic explained
- Store integration explained
- SDK integration explained
- 5-8 troubleshooting issues documented
- Each issue has symptoms, causes, solutions
- Code examples in troubleshooting
- Related documentation linked
- Markdown renders correctly
- Code blocks have language tags
- Tables format properly
- No broken links
- Consistent heading levels
- No typos
- Examples are realistic
- Examples work (tested)
- Widget imported in
cc-widgets/src/index.ts - Widget exported in
cc-widgets/src/index.ts - Widget imported in
cc-widgets/src/wc.ts(from dist/wc) - r2wc wrapper created
- All props mapped correctly in r2wc
- String props use 'string'
- Number props use 'number'
- Boolean props use 'boolean'
- Object/Array props use 'json'
- Function props use 'function'
- Custom element registered
- Element name:
widget-cc-{widget-name} - cc-widgets builds successfully:
yarn build
- Widget imported from @webex/cc-widgets
- Widget toggle state added
- Checkbox added to widget selector
- Callback handlers defined
- Widget rendering section added
- All required props passed
- Callbacks wired correctly
- Sample app runs:
yarn start - Widget appears when toggled on
- Widget disappears when toggled off
- Widget functions correctly
- Widget reference variable created
- Checkbox added to HTML
- Create widget function implemented
- Remove widget function implemented
- Toggle event listener attached
- Properties set correctly
- Event listeners attached correctly
- Widget appended to DOM correctly
- Sample app loads in browser
- Widget appears when toggled on
- Widget disappears when toggled off
- Widget functions correctly
- Events fire correctly (check console)
- Widget renders without errors
- All features work as expected
- Props passed correctly
- Callbacks fire correctly
- User interactions work
- Loading states display correctly
- Error states display correctly
- Empty states display correctly
- Data updates in real-time (if applicable)
- Store integration works
- SDK calls work
- Widget looks correct (matches design)
- Layout is correct
- Colors are correct
- Typography is correct
- Icons display correctly
- Spacing is correct
- Responsive (if applicable)
- Works in light theme
- Works in dark theme
- Chrome (latest)
- Firefox (latest)
- Safari (latest)
- Edge (latest)
- Keyboard navigation works
- Tab order is logical
- Focus visible
- Screen reader friendly
- ARIA labels present
- Color contrast sufficient
- No keyboard traps
- Widget renders quickly (< 1s)
- No memory leaks
- No excessive re-renders
- No console warnings
- No console errors
- Invalid props handled gracefully
- Missing props handled gracefully
- SDK errors handled gracefully
- Network errors handled gracefully
- Empty data handled gracefully
- User shown appropriate error message
- Error logged to console
-
onErrorcallback called
- Widget builds successfully
cd packages/contact-center/{widget-name} yarn build - No build errors
- No build warnings
- dist/ folder created
- Types generated (dist/types/)
- Source maps generated
- package.json name correct:
@webex/cc-{widget-name} - package.json description correct
- package.json version correct
- package.json main points to dist/index.js
- package.json types points to dist/types/index.d.ts
- Dependencies correct
- DevDependencies correct
- PeerDependencies correct
- All required files present
- No unnecessary files in dist/
- README or link to docs present
- License file present
- Follows TypeScript Patterns
- Follows React Patterns
- Follows MobX Patterns
- Follows Web Component Patterns
- Follows Testing Patterns
- Widget name is kebab-case:
agent-directory - Component name is PascalCase:
AgentDirectory - File names match conventions
- Function names are camelCase
- Constants are UPPER_SNAKE_CASE
- Types/Interfaces are PascalCase
- All modules from 01-06 completed
- Widget code generated
- Hook code generated
- Types defined
- Component created (if needed)
- Tests written
- Documentation written
- Linting passes
- Tests pass (100%)
- Build succeeds
- No console errors
- No console warnings
- cc-widgets updated
- React sample updated
- Web Component sample updated
- Both samples tested
- AGENTS.md complete
- ARCHITECTURE.md complete
- All examples tested
- All diagrams render
- All checklists completed
- No known issues
- Ready for peer review
- Ready for QA
- Ready for production
If any checklist items fail, document here:
| Issue | Severity | Description | Solution | Status |
|---|---|---|---|---|
| 1. | High/Med/Low | Description | Solution | Open/Fixed |
| 2. | High/Med/Low | Description | Solution | Open/Fixed |
| 3. | High/Med/Low | Description | Solution | Open/Fixed |
(Add any notes about the validation process, workarounds, or decisions made)
Validation completed by: _______________
Date: _______________
Widget name: _______________
Version: _______________
Status: ✅ READY FOR PRODUCTION /
Notes:
(Any final notes or observations)
If all checks pass:
- Commit changes to version control
- Create pull request
- Request peer review
- Update CHANGELOG
- Prepare for release
If checks fail:
- Document issues in tracking table
- Fix issues
- Re-run validation
- Repeat until all checks pass
Template Version: 1.0.0 Last Updated: 2025-11-26