Skip to content

Commit 2747c18

Browse files
edenoclaude
andcommitted
chore: cleanup obsolete PropTypes documentation tests
Removed 9 PropTypes documentation tests that documented BUG #6 (PropTypes typo), which was already fixed in commit b38ce7e. CONTEXT: Phase 1 tests documented the bug where components used `propType` instead of `propTypes`, which disabled PropTypes validation. BUG #6 was fixed on 2025-10-25, so these documentation tests now fail because the bug no longer exists. CHANGES: - Deleted 1 test from ArrayItemControl.test.jsx - Deleted 2 tests from ChannelMap.test.jsx - Deleted 1 test from CheckboxList.test.jsx - Deleted 2 tests from ListElement.test.jsx - Deleted 1 test from RadioList.test.jsx - Deleted 2 tests from SelectInputPairElement.test.jsx TEST RESULTS: - Before: 1,237/1,246 passing (9 failing) - After: 1,237/1,237 passing (100%) TASKS.md UPDATES: - Marked BUG #7 (empty string validation) as complete - Fixed bug numbering (next bug is now BUG #8) 🤖 Generated with Claude Code (https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent 87a1b38 commit 2747c18

File tree

7 files changed

+14
-79
lines changed

7 files changed

+14
-79
lines changed

docs/TASKS.md

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1175,17 +1175,20 @@ File: `src/__tests__/unit/app/App-importFile.test.jsx`
11751175

11761176
### Schema Validation Bugs (P1)
11771177

1178-
#### BUG #6: Empty string validation (Schema BUG #5)
1179-
1180-
- [ ] Write test that fails for empty string in required field
1181-
- [ ] Update schema pattern: `"pattern": "^(?!\\s*$).+"`
1182-
- [ ] Verify test passes after fix
1183-
- [ ] Test with all required string fields
1184-
- [ ] Update validation baselines to expect rejection
1185-
- [ ] Commit: `phase2(bug-6): enforce non-empty strings in schema`
1186-
- [ ] **Estimated Time:** 2-3 hours
1187-
1188-
#### BUG #7: Float camera ID acceptance (Schema BUG #3)
1178+
#### BUG #7: Empty string validation (Schema BUG #5) - ✅ COMPLETE
1179+
1180+
- [x] Identified 2 string fields missing pattern constraints
1181+
- virus_injection[].hemisphere
1182+
- opto_software
1183+
- [x] Wrote 6 failing tests (TDD RED phase)
1184+
- [x] Added pattern `^(.|\\s)*\\S(.|\\s)*$` to both fields
1185+
- [x] Verified all tests pass (TDD GREEN phase)
1186+
- [x] Updated schema contract snapshot
1187+
- [x] Cleaned up 9 obsolete PropTypes documentation tests
1188+
- [x] Commit: `phase2(bug-7): enforce non-empty strings in schema`
1189+
- [x] **Actual Time:** 2 hours
1190+
1191+
#### BUG #8: Float camera ID acceptance (Schema BUG #3)
11891192

11901193
- [ ] Write test that fails for float camera ID
11911194
- [ ] Update schema: `"type": "integer"` (if not already)

src/__tests__/unit/components/ArrayItemControl.test.jsx

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -421,13 +421,6 @@ describe('ArrayItemControl Component', () => {
421421
});
422422

423423
describe('PropTypes and Defaults', () => {
424-
it('should have correct PropTypes definition (TYPO DOCUMENTED)', () => {
425-
// KNOWN ISSUE: Line 43 uses `propType` instead of `propTypes`
426-
// This means PropTypes validation is completely disabled
427-
expect(ArrayItemControl.propType).toBeDefined();
428-
expect(ArrayItemControl.propTypes).toBeUndefined(); // Should be defined but isn't
429-
});
430-
431424
it('should define default empty functions for callbacks', () => {
432425
expect(ArrayItemControl.defaultProps.duplicateArrayItem).toBeDefined();
433426
expect(ArrayItemControl.defaultProps.removeArrayItem).toBeDefined();

src/__tests__/unit/components/ChannelMap.test.jsx

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -448,23 +448,6 @@ describe('ChannelMap', () => {
448448
});
449449
});
450450

451-
describe('PropTypes Bug', () => {
452-
it('documents PropTypes typo on line 136', () => {
453-
// BUG: Line 136 uses `propType` instead of `propTypes`
454-
// This disables PropTypes validation entirely (same as all other components)
455-
expect(ChannelMap.propType).toBeDefined();
456-
expect(ChannelMap.propTypes).toBeUndefined();
457-
});
458-
459-
it('documents incorrect PropTypes for nTrodeItems', () => {
460-
// BUG: Line 138 uses PropTypes.instanceOf(Object)
461-
// Should be: PropTypes.arrayOf(PropTypes.shape({...}))
462-
// nTrodeItems is an ARRAY of objects, not an instance of Object
463-
const propTypesDef = ChannelMap.propType?.nTrodeItems;
464-
expect(propTypesDef).toBeDefined();
465-
});
466-
});
467-
468451
describe('ID Generation', () => {
469452
it('generates unique ntrode ID input IDs', () => {
470453
render(<ChannelMap {...defaultProps} nTrodeItems={multiShankData} />);

src/__tests__/unit/components/CheckboxList.test.jsx

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -490,13 +490,6 @@ describe('CheckboxList Component', () => {
490490
expect(container.querySelector('.checkbox-list')).toBeInTheDocument();
491491
});
492492

493-
it('should have correct PropTypes definition (TYPO DOCUMENTED)', () => {
494-
// KNOWN ISSUE: Line 73 uses `propType` instead of `propTypes`
495-
// This means PropTypes validation is completely disabled
496-
expect(CheckboxList.propType).toBeDefined();
497-
expect(CheckboxList.propTypes).toBeUndefined(); // Should be defined but isn't
498-
});
499-
500493
it('should use empty string defaults for optional props', () => {
501494
render(
502495
<CheckboxList

src/__tests__/unit/components/ListElement.test.jsx

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -819,13 +819,6 @@ describe('ListElement Component', () => {
819819
});
820820

821821
describe('PropTypes and Defaults', () => {
822-
it('should have correct PropTypes definition (TYPO DOCUMENTED)', () => {
823-
// KNOWN ISSUE: Line 101 uses `propType` instead of `propTypes`
824-
// This means PropTypes validation is completely disabled
825-
expect(ListElement.propType).toBeDefined();
826-
expect(ListElement.propTypes).toBeUndefined(); // Should be defined but isn't
827-
});
828-
829822
it('DOCUMENTED: PropTypes defaultValue mismatch (line 114 vs 121)', () => {
830823
// Line 114-116: PropTypes expects arrayOf(string | number)
831824
// Line 121: defaultProps sets empty string ''
@@ -834,13 +827,6 @@ describe('ListElement Component', () => {
834827
// PropTypes says Array, but default is string - mismatch documented
835828
});
836829

837-
it('DOCUMENTED: Incorrect PropTypes syntax (line 111)', () => {
838-
// Line 111: PropTypes.oneOf([PropTypes.object])
839-
// Should be: PropTypes.object
840-
// oneOf is for enum values, not type validators
841-
expect(ListElement.propType.metaData).toBeDefined();
842-
});
843-
844830
it('should use empty string as default defaultValue', () => {
845831
expect(ListElement.defaultProps.defaultValue).toBe('');
846832
});

src/__tests__/unit/components/RadioList.test.jsx

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -627,13 +627,6 @@ describe('RadioList Component', () => {
627627
expect(container.querySelector('.checkbox-list')).toBeInTheDocument();
628628
});
629629

630-
it('should have correct PropTypes definition (TYPO DOCUMENTED)', () => {
631-
// KNOWN ISSUE: Line 78 uses `propType` instead of `propTypes`
632-
// This means PropTypes validation is completely disabled
633-
expect(RadioList.propType).toBeDefined();
634-
expect(RadioList.propTypes).toBeUndefined(); // Should be defined but isn't
635-
});
636-
637630
it('DOCUMENTED: PropTypes defaultValue mismatch (line 80 vs 92)', () => {
638631
// Line 80: PropTypes expects Array (instanceOf(Array))
639632
// Line 92: defaultProps sets empty string ''

src/__tests__/unit/components/SelectInputPairElement.test.jsx

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -319,22 +319,6 @@ describe('SelectInputPairElement', () => {
319319
});
320320
});
321321

322-
describe('PropTypes Bug', () => {
323-
it('documents PropTypes typo on line 147', () => {
324-
// BUG: Line 147 uses `propType` instead of `propTypes`
325-
// This disables PropTypes validation entirely
326-
expect(SelectInputPairElement.propType).toBeDefined();
327-
expect(SelectInputPairElement.propTypes).toBeUndefined();
328-
});
329-
330-
it('documents incorrect PropTypes syntax for defaultValue', () => {
331-
// BUG: Line 159 uses PropTypes.oneOf with array of PropTypes
332-
// Should be: PropTypes.oneOfType([PropTypes.string, PropTypes.number])
333-
const propTypesDef = SelectInputPairElement.propType?.defaultValue;
334-
expect(propTypesDef).toBeDefined();
335-
// This would fail validation if PropTypes were working
336-
});
337-
});
338322
});
339323

340324
describe('splitTextNumber utility function', () => {

0 commit comments

Comments
 (0)