Conversation
… and Edge Case Tests Implements five new test suites as specified in issue #234: 1. MPNotificationTests (HIGH priority) - Tests for NSNotificationCenter observer patterns - Preference change notifications - Theme and font change notifications - Observer cleanup and thread safety tests 2. MPDocumentLifecycleTests (MEDIUM priority) - Document dirty flag management - Revert behavior tests - Encoding detection (UTF-8, BOM, ASCII) - File conflict detection - File deletion during edit scenarios 3. MPRendererEdgeCaseTests (MEDIUM priority) - Nil data source/delegate handling - Empty and whitespace-only markdown - Markdown extension combinations - Malformed HTML in code blocks - Concurrent render requests - MathJax, Mermaid, and Graphviz support - Front matter handling 4. HGMarkdownHighlighterTests (LOWER priority) - Property getter/setter tests - Style parsing error callbacks - Activation/deactivation without text view - Stress tests for rapid property changes 5. MPImageExportTests (LOWER priority) - Base64 embedded images (PNG, GIF, JPEG) - Linked external images (HTTP, HTTPS, relative paths) - Invalid image URLs (empty, malformed, XSS attempts) - Alt text and title preservation - Reference-style images All tests designed to run headless in CI environment. Related to #234
Updated the following documents to reflect the completion of Issue #234: - test_coverage_improvement_plan.md: Updated test file count, added new test suites to inventory, marked phases as completed - infrastructure_evaluation.md: Updated test file count, added new test files and coverage areas to the documentation - xcuitest.md: Expanded test coverage sections, marked critical gaps as partially addressed Related to #234
Contributor
Code Coverage ReportCurrent Coverage: 51.30% Coverage Details (Summary) |
Add hoedown/document.h import to resolve HOEDOWN_EXT_TABLES undeclared identifier error. Related to #234
Guard against multiple calls to [expectation fulfill] since NSUserDefaultsDidChangeNotification can fire multiple times when preferences are changed. Also removed unnecessary restore/synchronize since only one notification is needed to verify the mechanism works. Related to #234
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements Test Coverage Phase 1b as specified in issue #234, adding comprehensive test suites for notification/observer integration, document lifecycle, renderer edge cases, highlighter coverage gaps, and image handling in exports.
New Test Suites Added (5 files, 2,591 lines)
MPNotificationTests.m (HIGH priority)
MPDocumentLifecycleTests.m (MEDIUM priority)
MPRendererEdgeCaseTests.m (MEDIUM priority)
HGMarkdownHighlighterTests.m (LOWER priority)
MPImageExportTests.m (LOWER priority)
Related Issue
Related to #234
Test Coverage
All tests are designed to run headless in CI environment. Tests follow established patterns from Phase 1 (#197) and use existing test helpers (MPMockRendererDataSource, MPMockRendererDelegate).
Success Criteria from Issue #234
Manual Testing Plan
Not required - this PR adds only unit tests with no behavioral changes to the application.
Review Notes
plans/directory to reflect new test coverage