Skip to content

Set up Svelte Component Testing Infrastructure - #164

Merged
malibio merged 5 commits into
mainfrom
feature/issue-151-svelte-component-testing-infrastructure
Oct 5, 2025
Merged

malibio merged 5 commits into
mainfrom
feature/issue-151-svelte-component-testing-infrastructure

Conversation

@malibio

@malibio malibio commented Oct 5, 2025

Copy link
Copy Markdown
Collaborator

Closes #151

malibio and others added 5 commits October 5, 2025 22:33
The getProjectItems() method was only fetching the first 100 project items
due to a hardcoded GraphQL query limit without pagination. This caused issues
beyond #100 to be "not found" when using bun run gh:status and other project
management commands.

Fix adds proper GraphQL pagination using pageInfo.hasNextPage and endCursor
to fetch all project items (currently 116 total).

Impact: Project management commands (gh:status, gh:assign, etc.) now work
correctly for all issues in the project, not just the first 100.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
- Create reusable test utilities (svelte-test-utils.ts)
  - Type-safe component rendering with renderComponent()
  - User event setup with createUserEvents()
  - Async effect waiting for Svelte 5 runes
  - Event handler mocking and propagation verification
  - ARIA testing helpers and lifecycle utilities

- Create comprehensive NodeAutocomplete tests (node-autocomplete.test.ts)
  - 26 test cases covering rendering, keyboard navigation, events
  - Event propagation verification (stopPropagation)
  - Component lifecycle testing (event listener cleanup)
  - Accessibility testing (ARIA attributes)
  - Mouse interactions and edge cases

- Add component testing documentation (component-testing-guide.md)
  - Svelte 5 runes testing patterns
  - Keyboard event testing
  - Event propagation verification
  - Component lifecycle testing
  - Common pitfalls and solutions

All tests follow Testing Library best practices and use Svelte 5 APIs.
Fixed TypeScript errors using proper event handling and component patterns.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
… config

- Fix Vite/PostCSS preprocessing error by using svelte plugin in test mode
- Add Svelte 5 callback props (onselect, onclose) for event handling
- Update all tests to use callback props instead of deprecated $on()
- Add argsIgnorePattern to ESLint for Svelte type-only parameters
- Remove extraneous meta-documentation files
- All 40 tests passing

Addresses all findings from pragmatic-code-review

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
- Fix hardcoded absolute paths in vitest.config.ts
  - Use path.resolve(__dirname) for cross-platform compatibility
  - Ensures tests work on all developer machines and CI environments

- Improve type safety documentation in test utilities
  - Add detailed comments explaining required 'as any' type assertions
  - Document @testing-library/svelte v5 type incompatibility
  - Use proper ESLint disable comments with justification

- Remove dual event handling pattern in NodeAutocomplete
  - Keep only Svelte 5 callback props (onselect, onclose)
  - Remove deprecated createEventDispatcher pattern
  - Reduces redundancy and maintenance burden

All 40 node-autocomplete tests passing
Zero lint warnings or errors (bun run quality:fix passes)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
CRITICAL FIXES:
- Remove all ESLint disable comments (zero tolerance policy)
  - Use proper type assertions through 'never' and 'unknown'
  - Define StopPropagationFn type for mock checking

- Fix breaking change in base-node.svelte
  - Update NodeAutocomplete event handlers from on:select/on:close to onselect/onclose
  - Change handleAutocompleteSelect signature from CustomEvent<NodeResult> to NodeResult
  - Maintains backward compatibility with parent component dispatch

VERIFICATION:
- All 40 node-autocomplete tests passing
- bun run quality:fix passes: 0 errors, 0 warnings
- svelte-check passes: 0 errors, 0 warnings
- Zero tolerance for lint warnings maintained

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
@malibio
malibio merged commit a21c7f8 into main Oct 5, 2025
@malibio
malibio deleted the feature/issue-151-svelte-component-testing-infrastructure branch October 5, 2025 21:51
malibio added a commit that referenced this pull request Feb 4, 2026
* Fix: Add pagination to GitHub project items query

The getProjectItems() method was only fetching the first 100 project items
due to a hardcoded GraphQL query limit without pagination. This caused issues
beyond #100 to be "not found" when using bun run gh:status and other project
management commands.

Fix adds proper GraphQL pagination using pageInfo.hasNextPage and endCursor
to fetch all project items (currently 116 total).

Impact: Project management commands (gh:status, gh:assign, etc.) now work
correctly for all issues in the project, not just the first 100.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>

* Add Svelte component testing infrastructure (closes #151)

- Create reusable test utilities (svelte-test-utils.ts)
  - Type-safe component rendering with renderComponent()
  - User event setup with createUserEvents()
  - Async effect waiting for Svelte 5 runes
  - Event handler mocking and propagation verification
  - ARIA testing helpers and lifecycle utilities

- Create comprehensive NodeAutocomplete tests (node-autocomplete.test.ts)
  - 26 test cases covering rendering, keyboard navigation, events
  - Event propagation verification (stopPropagation)
  - Component lifecycle testing (event listener cleanup)
  - Accessibility testing (ARIA attributes)
  - Mouse interactions and edge cases

- Add component testing documentation (component-testing-guide.md)
  - Svelte 5 runes testing patterns
  - Keyboard event testing
  - Event propagation verification
  - Component lifecycle testing
  - Common pitfalls and solutions

All tests follow Testing Library best practices and use Svelte 5 APIs.
Fixed TypeScript errors using proper event handling and component patterns.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>

* Fix code review issues: PostCSS preprocessing, event handling, ESLint config

- Fix Vite/PostCSS preprocessing error by using svelte plugin in test mode
- Add Svelte 5 callback props (onselect, onclose) for event handling
- Update all tests to use callback props instead of deprecated $on()
- Add argsIgnorePattern to ESLint for Svelte type-only parameters
- Remove extraneous meta-documentation files
- All 40 tests passing

Addresses all findings from pragmatic-code-review

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>

* Fix code review findings: hardcoded paths, type safety, event pattern

- Fix hardcoded absolute paths in vitest.config.ts
  - Use path.resolve(__dirname) for cross-platform compatibility
  - Ensures tests work on all developer machines and CI environments

- Improve type safety documentation in test utilities
  - Add detailed comments explaining required 'as any' type assertions
  - Document @testing-library/svelte v5 type incompatibility
  - Use proper ESLint disable comments with justification

- Remove dual event handling pattern in NodeAutocomplete
  - Keep only Svelte 5 callback props (onselect, onclose)
  - Remove deprecated createEventDispatcher pattern
  - Reduces redundancy and maintenance burden

All 40 node-autocomplete tests passing
Zero lint warnings or errors (bun run quality:fix passes)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>

* Fix: Remove lint suppressions and complete event pattern migration

CRITICAL FIXES:
- Remove all ESLint disable comments (zero tolerance policy)
  - Use proper type assertions through 'never' and 'unknown'
  - Define StopPropagationFn type for mock checking

- Fix breaking change in base-node.svelte
  - Update NodeAutocomplete event handlers from on:select/on:close to onselect/onclose
  - Change handleAutocompleteSelect signature from CustomEvent<NodeResult> to NodeResult
  - Maintains backward compatibility with parent component dispatch

VERIFICATION:
- All 40 node-autocomplete tests passing
- bun run quality:fix passes: 0 errors, 0 warnings
- svelte-check passes: 0 errors, 0 warnings
- Zero tolerance for lint warnings maintained

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>

---------

Co-authored-by: Claude <[email protected]>
malibio added a commit that referenced this pull request Feb 5, 2026
* Fix: Add pagination to GitHub project items query

The getProjectItems() method was only fetching the first 100 project items
due to a hardcoded GraphQL query limit without pagination. This caused issues
beyond #100 to be "not found" when using bun run gh:status and other project
management commands.

Fix adds proper GraphQL pagination using pageInfo.hasNextPage and endCursor
to fetch all project items (currently 116 total).

Impact: Project management commands (gh:status, gh:assign, etc.) now work
correctly for all issues in the project, not just the first 100.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>

* Add Svelte component testing infrastructure (closes #151)

- Create reusable test utilities (svelte-test-utils.ts)
  - Type-safe component rendering with renderComponent()
  - User event setup with createUserEvents()
  - Async effect waiting for Svelte 5 runes
  - Event handler mocking and propagation verification
  - ARIA testing helpers and lifecycle utilities

- Create comprehensive NodeAutocomplete tests (node-autocomplete.test.ts)
  - 26 test cases covering rendering, keyboard navigation, events
  - Event propagation verification (stopPropagation)
  - Component lifecycle testing (event listener cleanup)
  - Accessibility testing (ARIA attributes)
  - Mouse interactions and edge cases

- Add component testing documentation (component-testing-guide.md)
  - Svelte 5 runes testing patterns
  - Keyboard event testing
  - Event propagation verification
  - Component lifecycle testing
  - Common pitfalls and solutions

All tests follow Testing Library best practices and use Svelte 5 APIs.
Fixed TypeScript errors using proper event handling and component patterns.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>

* Fix code review issues: PostCSS preprocessing, event handling, ESLint config

- Fix Vite/PostCSS preprocessing error by using svelte plugin in test mode
- Add Svelte 5 callback props (onselect, onclose) for event handling
- Update all tests to use callback props instead of deprecated $on()
- Add argsIgnorePattern to ESLint for Svelte type-only parameters
- Remove extraneous meta-documentation files
- All 40 tests passing

Addresses all findings from pragmatic-code-review

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>

* Fix code review findings: hardcoded paths, type safety, event pattern

- Fix hardcoded absolute paths in vitest.config.ts
  - Use path.resolve(__dirname) for cross-platform compatibility
  - Ensures tests work on all developer machines and CI environments

- Improve type safety documentation in test utilities
  - Add detailed comments explaining required 'as any' type assertions
  - Document @testing-library/svelte v5 type incompatibility
  - Use proper ESLint disable comments with justification

- Remove dual event handling pattern in NodeAutocomplete
  - Keep only Svelte 5 callback props (onselect, onclose)
  - Remove deprecated createEventDispatcher pattern
  - Reduces redundancy and maintenance burden

All 40 node-autocomplete tests passing
Zero lint warnings or errors (bun run quality:fix passes)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>

* Fix: Remove lint suppressions and complete event pattern migration

CRITICAL FIXES:
- Remove all ESLint disable comments (zero tolerance policy)
  - Use proper type assertions through 'never' and 'unknown'
  - Define StopPropagationFn type for mock checking

- Fix breaking change in base-node.svelte
  - Update NodeAutocomplete event handlers from on:select/on:close to onselect/onclose
  - Change handleAutocompleteSelect signature from CustomEvent<NodeResult> to NodeResult
  - Maintains backward compatibility with parent component dispatch

VERIFICATION:
- All 40 node-autocomplete tests passing
- bun run quality:fix passes: 0 errors, 0 warnings
- svelte-check passes: 0 errors, 0 warnings
- Zero tolerance for lint warnings maintained

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>

---------

Co-authored-by: Claude <[email protected]>
malibio added a commit that referenced this pull request Feb 26, 2026
* Fix: Add pagination to GitHub project items query

The getProjectItems() method was only fetching the first 100 project items
due to a hardcoded GraphQL query limit without pagination. This caused issues
beyond #100 to be "not found" when using bun run gh:status and other project
management commands.

Fix adds proper GraphQL pagination using pageInfo.hasNextPage and endCursor
to fetch all project items (currently 116 total).

Impact: Project management commands (gh:status, gh:assign, etc.) now work
correctly for all issues in the project, not just the first 100.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>

* Add Svelte component testing infrastructure (closes #151)

- Create reusable test utilities (svelte-test-utils.ts)
  - Type-safe component rendering with renderComponent()
  - User event setup with createUserEvents()
  - Async effect waiting for Svelte 5 runes
  - Event handler mocking and propagation verification
  - ARIA testing helpers and lifecycle utilities

- Create comprehensive NodeAutocomplete tests (node-autocomplete.test.ts)
  - 26 test cases covering rendering, keyboard navigation, events
  - Event propagation verification (stopPropagation)
  - Component lifecycle testing (event listener cleanup)
  - Accessibility testing (ARIA attributes)
  - Mouse interactions and edge cases

- Add component testing documentation (component-testing-guide.md)
  - Svelte 5 runes testing patterns
  - Keyboard event testing
  - Event propagation verification
  - Component lifecycle testing
  - Common pitfalls and solutions

All tests follow Testing Library best practices and use Svelte 5 APIs.
Fixed TypeScript errors using proper event handling and component patterns.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>

* Fix code review issues: PostCSS preprocessing, event handling, ESLint config

- Fix Vite/PostCSS preprocessing error by using svelte plugin in test mode
- Add Svelte 5 callback props (onselect, onclose) for event handling
- Update all tests to use callback props instead of deprecated $on()
- Add argsIgnorePattern to ESLint for Svelte type-only parameters
- Remove extraneous meta-documentation files
- All 40 tests passing

Addresses all findings from pragmatic-code-review

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>

* Fix code review findings: hardcoded paths, type safety, event pattern

- Fix hardcoded absolute paths in vitest.config.ts
  - Use path.resolve(__dirname) for cross-platform compatibility
  - Ensures tests work on all developer machines and CI environments

- Improve type safety documentation in test utilities
  - Add detailed comments explaining required 'as any' type assertions
  - Document @testing-library/svelte v5 type incompatibility
  - Use proper ESLint disable comments with justification

- Remove dual event handling pattern in NodeAutocomplete
  - Keep only Svelte 5 callback props (onselect, onclose)
  - Remove deprecated createEventDispatcher pattern
  - Reduces redundancy and maintenance burden

All 40 node-autocomplete tests passing
Zero lint warnings or errors (bun run quality:fix passes)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>

* Fix: Remove lint suppressions and complete event pattern migration

CRITICAL FIXES:
- Remove all ESLint disable comments (zero tolerance policy)
  - Use proper type assertions through 'never' and 'unknown'
  - Define StopPropagationFn type for mock checking

- Fix breaking change in base-node.svelte
  - Update NodeAutocomplete event handlers from on:select/on:close to onselect/onclose
  - Change handleAutocompleteSelect signature from CustomEvent<NodeResult> to NodeResult
  - Maintains backward compatibility with parent component dispatch

VERIFICATION:
- All 40 node-autocomplete tests passing
- bun run quality:fix passes: 0 errors, 0 warnings
- svelte-check passes: 0 errors, 0 warnings
- Zero tolerance for lint warnings maintained

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>

---------

Co-authored-by: Claude <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Set up Svelte Component Testing Infrastructure

1 participant