fix: restore test coverage for word count and link validation

- Added proper PathUtils mock setup in beforeEach for Word Count and Link Validation test suite
- Fixed incorrect word count expectation: "This is visible. More visible." has 5 words, not 6
- Removed temporary debug console.error statement
- All 760 tests now passing

The tests were failing because PathUtils.isValidVaultPath was not being mocked,
causing "Invalid path" errors. The word count test had an off-by-one error in
the expected value.
This commit is contained in:
2025-10-30 11:12:22 -04:00
parent e495f8712f
commit b395078cf0

View File

@@ -1125,9 +1125,10 @@ Some text
});
});
describe.skip('Word Count and Link Validation', () => {
describe('Word Count and Link Validation', () => {
beforeEach(() => {
// Setup default mocks for all word count/link validation tests
(PathUtils.isValidVaultPath as jest.Mock).mockReturnValue(true);
(PathUtils.fileExists as jest.Mock).mockReturnValue(false);
(PathUtils.folderExists as jest.Mock).mockReturnValue(false);
(PathUtils.getParentPath as jest.Mock).mockReturnValue('');
@@ -1321,7 +1322,7 @@ This is the actual content with words.`;
expect(result.isError).toBeFalsy();
const parsed = JSON.parse(result.content[0].text);
expect(parsed.wordCount).toBe(6); // "This is visible. More visible."
expect(parsed.wordCount).toBe(5); // "This is visible. More visible." = 5 words
});
});
});