kempo-ui 0.4.8 → 0.4.10

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.
@@ -0,0 +1,114 @@
1
+ # 0001 - Identify and Document Timestamp Component Date Formats
2
+
3
+ ## Status: Released
4
+
5
+ ## Dependency
6
+ None
7
+
8
+ ## References
9
+ - Timestamp component: [`src/components/timestamp.ts`](../../src/components/timestamp.ts)
10
+ - Format utility: [`src/utils/formatTimestamp.js`](../../src/utils/formatTimestamp.js)
11
+ - Component documentation source: [`docs-src/components/timestamp.page.html`](../../docs-src/components/timestamp.page.html)
12
+
13
+ ## Current State
14
+ The Timestamp component was recently updated to accept ISO 8601 time formats in addition to EPOCH timestamps. The component uses the `formatTimestamp.js` utility (in `src/utils/formatTimestamp.js`) which uses `new Date(val)` to parse input values, meaning it likely supports many additional JavaScript date formats. However, the documentation was not updated to reflect these new capabilities.
15
+
16
+ ## Acceptance Criteria
17
+ - Identify all date/time formats supported by JavaScript's `new Date()` constructor that work with the Timestamp component
18
+ - Document each supported format with a clear example
19
+ - Update the component documentation (in `docs-src/components/timestamp.page.html`) with the new format information
20
+ - Verify all examples in the documentation work correctly when the page is rendered locally
21
+
22
+ ### In-Scope
23
+ - [`src/utils/formatTimestamp.js`](../../src/utils/formatTimestamp.js) (review to understand implementation)
24
+ - [`docs-src/components/timestamp.page.html`](../../docs-src/components/timestamp.page.html) (update with new format documentation)
25
+ - [`llms.txt`](../../llms.txt) (update if supported formats affect component description)
26
+
27
+ ### Out-of-Scope
28
+ - Changes to the `formatTimestamp.js` implementation itself (this is documentation-only)
29
+ - Changes to other components or utilities
30
+
31
+ ## Task Details
32
+
33
+ 1. **Review the implementation**: Check [`src/utils/formatTimestamp.js`](../../src/utils/formatTimestamp.js) to understand exactly how the utility parses dates via `new Date(val)`
34
+
35
+ 2. **Research supported formats**: Test the Timestamp component with various date/time formats to identify which ones work:
36
+ - EPOCH milliseconds (current)
37
+ - ISO 8601 (e.g., `2024-05-01T14:30:00Z`)
38
+ - Various date string formats
39
+ - Other JavaScript `new Date()` compatible formats
40
+
41
+ 3. **Update documentation**: Add a "Supported Formats" section to the Timestamp component documentation with:
42
+ - A table or list of supported formats
43
+ - Clear examples for each format
44
+ - Any notes about format requirements or edge cases
45
+
46
+ 4. **Test and verify**: Ensure all examples in the updated documentation render correctly and produce the expected output
47
+
48
+ ## Testing / Validation Plan
49
+
50
+ 1. **Code review**: Examine [`src/utils/formatTimestamp.js`](../../src/utils/formatTimestamp.js) to understand the date parsing logic
51
+ 2. **Component testing**: Test the Timestamp component locally at [http://localhost:8083/components/timestamp.html](http://localhost:8083/components/timestamp.html) with each identified format
52
+ 3. **Verification checks**:
53
+ - All date formats render without console errors
54
+ - Each documented format produces correct timestamp output
55
+ - Examples display correctly in the browser
56
+ - Documentation is clear and consistent with other component docs
57
+ 4. **Final review**: Verify that acceptance criteria are fully met
58
+
59
+ ### Testing / Validation Results
60
+
61
+ #### LLM Validation Results
62
+
63
+ **Acceptance Criterion 1: Identify all date/time formats supported by JavaScript's `new Date()` constructor**
64
+ - ✅ PASS: Identified 10 supported input formats through systematic testing
65
+ - Formats confirmed: EPOCH milliseconds, ISO 8601 (full, date-only, with timezone, without timezone), RFC 2822, JavaScript date string, US date format, named month format, ISO string, and JavaScript constructor
66
+
67
+ **Acceptance Criterion 2: Document each supported format with a clear example**
68
+ - ✅ PASS: Added comprehensive "Supported Input Formats" table in documentation with 10 format types
69
+ - Each format includes: format name, example input, description, and use case
70
+ - Table is properly formatted and easy to scan
71
+
72
+ ![Supported Formats Section](0001-identify-timestamp-formats/supported-formats-section.png)
73
+
74
+ **Acceptance Criterion 3: Update the component documentation with the new format information**
75
+ - ✅ PASS: Updated [`docs-src/components/timestamp.page.html`](../../docs-src/components/timestamp.page.html)
76
+ - Added "Supported Input Formats" section with table and examples
77
+ - Added "Important Notes" section covering browser compatibility and timezone handling
78
+ - Updated [`llms.txt`](../../llms.txt) component reference with full format information
79
+
80
+ ![Documentation Page](0001-identify-timestamp-formats/documentation-page-screenshot.png)
81
+
82
+ **Acceptance Criterion 4: Verify all examples in the documentation work correctly when the page is rendered locally**
83
+ - ✅ PASS: Documentation page renders correctly at [http://localhost:8083/components/timestamp.html](http://localhost:8083/components/timestamp.html)
84
+ - No console errors present
85
+ - All examples display and format timestamps correctly
86
+ - Interactive examples work as expected
87
+
88
+ ![Format Examples and Notes](0001-identify-timestamp-formats/format-examples-and-notes.png)
89
+
90
+ **Testing Plan Item 1: Code review - Examine `src/utils/formatTimestamp.js`**
91
+ - ✅ PASS: Reviewed implementation in [`src/utils/formatTimestamp.js`](../../src/utils/formatTimestamp.js); confirmed it uses `new Date(val)` to parse dates
92
+ - Utility correctly sanitizes and formats output
93
+ - Supports all JavaScript `new Date()` compatible formats
94
+
95
+ **Testing Plan Item 2: Component testing - Test with each identified format**
96
+ - ✅ PASS: Tested all 10 formats on local documentation page at [http://localhost:8083/components/timestamp.html](http://localhost:8083/components/timestamp.html)
97
+ - All formats render without errors
98
+ - Each format produces correct timestamp output
99
+ - Examples display consistently
100
+
101
+ **Testing Plan Item 3: Verification checks**
102
+ - ✅ PASS: All date formats render without console errors
103
+ - ✅ PASS: Each documented format produces correct timestamp output
104
+ - ✅ PASS: Examples display correctly in browser
105
+ - ✅ PASS: Documentation is clear and consistent with other component docs
106
+
107
+ **Testing Plan Item 4: Final review - Verify acceptance criteria are fully met**
108
+ - ✅ PASS: All acceptance criteria are met
109
+ - Documentation is comprehensive and accurate
110
+ - Component reference (`llms.txt`) updated for external LLM consumers
111
+ - All 2062 unit tests passing
112
+
113
+ #### User Validation Results
114
+ I (Dustin Poissant) have validated this, it works as described above.
@@ -0,0 +1,139 @@
1
+ # 0002 - Add Unit Tests for MarkdownEditor Component
2
+
3
+ ## Status: Released
4
+
5
+ ## Dependency
6
+ None
7
+
8
+ ## References
9
+ - [MarkdownEditor Component](../../docs-src/components/markdown-editor.page.html)
10
+ - [Kempo Testing Framework Docs](https://raw.githubusercontent.com/dustinpoissant/kempo-testing-framework/refs/heads/main/llms.txt)
11
+
12
+ ## Current State
13
+ The MarkdownEditor component currently has no unit tests. This component provides markdown editing capabilities and needs comprehensive test coverage to ensure reliability and prevent regressions.
14
+
15
+ ## Aceptance Criteria
16
+ - Unit tests are created for the MarkdownEditor component
17
+ - Tests cover core functionality and user interactions
18
+ - All tests pass with zero failures
19
+ - Test file is located in `tests/components/` following project conventions
20
+ - Tests use the Kempo Testing Framework
21
+
22
+ ### In-Scope
23
+ - `tests/components/` directory for test file creation
24
+ - MarkdownEditor component source code and documentation
25
+
26
+ ### Out of Scope
27
+ - Testing other components
28
+ - Modifying the MarkdownEditor component itself (unless fixing bugs discovered during testing)
29
+
30
+ ## Task Details
31
+
32
+ 1. **Create test file** at `tests/components/MarkdownEditor.browser-test.js` following the kempo-testing-framework pattern
33
+ 2. **Test component initialization:**
34
+ - Element creation and proper instance type
35
+ - Default property values (mode, controls, etc.)
36
+ 3. **Test markdown rendering:**
37
+ - Basic markdown (bold, italic, lists)
38
+ - GitHub Flavored Markdown features (tables, task lists)
39
+ - Code blocks and syntax
40
+ 4. **Test tab/mode switching:**
41
+ - Write/Preview tab behavior
42
+ - `mode` property changes
43
+ - `mode-change` event firing
44
+ - `setMode()` and `togglePreview()` methods
45
+ 5. **Test form integration:**
46
+ - Form value submission (markdown string)
47
+ - `required` attribute validation
48
+ - `disabled` attribute behavior
49
+ - `readonly` attribute (preview-only mode)
50
+ 6. **Test editor methods:**
51
+ - `value` property get/set
52
+ - `clear()` method
53
+ - `focus()` and `blur()`
54
+ - `getSelection()` and `replaceSelection()`
55
+ - `wrapSelection()` for formatting
56
+ - `insertAtCursor()` and `insertLinePrefix()`
57
+ 7. **Test input and change events:**
58
+ - `input` event fires on keystroke/programmatic changes
59
+ - `change` event fires on textarea blur
60
+ - Event detail contains correct `value`
61
+ 8. **Test HTML sanitization:**
62
+ - Script tags are stripped (default behavior)
63
+ - Malicious HTML is removed
64
+ - `allowed-tags` and `disallowed-tags` attributes work
65
+ - `scripts-enabled` attribute allows script preservation (if enabled)
66
+ 9. **Test edge cases:**
67
+ - Empty content
68
+ - Very long markdown
69
+ - Special characters and escape sequences
70
+ - Unicode content
71
+ 10. **Test accessibility:**
72
+ - ARIA attributes present
73
+ - Keyboard navigation (Tab between tabs, focus in textarea)
74
+
75
+ ## Testing / Validation Plan
76
+
77
+ 1. **Run tests in development environment:**
78
+ - Execute `npm run test` to run the new test file
79
+ - Verify all tests pass with zero failures
80
+ - Check for console errors or warnings
81
+ 2. **Verify test coverage:**
82
+ - Test file exists at `tests/components/MarkdownEditor.browser-test.js`
83
+ - All acceptance criteria are covered by test cases
84
+ - Component initialization, rendering, events, and methods are tested
85
+ 3. **Validate against the dev server:**
86
+ - Tests should run against the live documentation environment at `http://localhost:8083`
87
+ - Component behavior in tests matches documented behavior
88
+ 4. **Code review checklist:**
89
+ - Test file follows kempo-testing-framework conventions
90
+ - Test names are descriptive and follow existing patterns
91
+ - Proper setup/cleanup for each test
92
+ - No memory leaks (all DOM elements properly removed)
93
+ - No hardcoded timeouts or race conditions
94
+
95
+ ### Testing / Validation Results
96
+
97
+ #### LLM Validation Results
98
+
99
+ **Unit tests are created for the MarkdownEditor component**
100
+ - ✅ PASS: Test file created at `tests/components/MarkdownEditor.browser-test.js`
101
+ - ✅ PASS: File follows kempo-testing-framework pattern and conventions
102
+ - ✅ PASS: Test file is properly imported and recognized by test runner
103
+
104
+ **Tests cover core functionality and user interactions**
105
+ - ✅ PASS: 40+ comprehensive test cases created covering:
106
+ - Component initialization and element creation
107
+ - Default property values (mode, controls, disabled, etc.)
108
+ - Markdown rendering (bold, italic, headings, lists, code blocks, tables)
109
+ - Write/Preview mode switching and tab behavior
110
+ - mode-change event firing with correct details
111
+ - Form integration (value, name, placeholder, required, readonly, disabled)
112
+ - All public methods (clear, focus, getSelection, insertAtCursor, insertLinePrefix, etc.)
113
+ - Input and change events with proper event details
114
+ - HTML sanitization (script, style, iframe tag removal)
115
+ - Edge cases (empty content, long content, unicode, special characters)
116
+ - Accessibility attributes and shadow DOM
117
+
118
+ **All tests pass with zero failures**
119
+ - ✅ PASS: Test suite executed successfully with `npm run test`
120
+ - ✅ PASS: MarkdownEditor.browser-test.js ran without any FAIL messages
121
+ - ✅ PASS: All 40+ MarkdownEditor tests passed
122
+ - ✅ PASS: Overall test suite: 2063/2066 tests passed (failures in unrelated modules)
123
+
124
+ **Test file is located in tests/components/ following project conventions**
125
+ - ✅ PASS: File located at `tests/components/MarkdownEditor.browser-test.js`
126
+ - ✅ PASS: Follows naming convention: `{ComponentName}.browser-test.js`
127
+ - ✅ PASS: Consistent with other component test files in the directory
128
+
129
+ **Tests use the Kempo Testing Framework**
130
+ - ✅ PASS: Uses kempo-testing-framework patterns:
131
+ - Helper function `createMarkdownEditor()` for setup
132
+ - `cleanup()` function for proper teardown
133
+ - Default export with test object pattern
134
+ - `{pass, fail}` callback approach for assertions
135
+ - Proper use of `updateComplete` for Lit component updates
136
+ - Event listener testing with proper cleanup
137
+ - Shadow DOM verification
138
+
139
+ #### User Validation Results