feat(tests): fully implemented test suite

This commit is contained in:
2025-05-26 05:16:32 +00:00
parent 1d52ce1211
commit 113ae22c42
40 changed files with 3747 additions and 37 deletions

View File

@ -29,7 +29,7 @@ tap.test('PDF-02: ZUGFeRD v1 Extraction - Basic Extraction', async (tools) => {
// Check if file exists and is readable
const fileExists = await plugins.fs.pathExists(testFile);
expect(fileExists).toBe(true);
expect(fileExists).toBeTrue();
const fileStats = await plugins.fs.stat(testFile);
tools.log(`File size: ${(fileStats.size / 1024).toFixed(1)}KB`);
@ -233,8 +233,8 @@ tap.test('PDF-02: ZUGFeRD v1 Extraction - Format Validation', async (tools) => {
tools.log(`- Is Well-Formed: ${formatChecks.isWellFormed}`);
// Basic format expectations
expect(formatChecks.hasXmlDeclaration).toBe(true);
expect(formatChecks.isWellFormed).toBe(true);
expect(formatChecks.hasXmlDeclaration).toBeTrue();
expect(formatChecks.isWellFormed).toBeTrue();
if (formatChecks.hasZugferdNamespace && formatChecks.hasInvoiceElements) {
tools.log('✓ ZUGFeRD v1 format validation passed');

View File

@ -28,7 +28,7 @@ tap.test('PDF-03: Factur-X Extraction - Basic ZUGFeRD v2 Extraction', async (too
// Check file accessibility
const fileExists = await plugins.fs.pathExists(testFile);
expect(fileExists).toBe(true);
expect(fileExists).toBeTrue();
const fileStats = await plugins.fs.stat(testFile);
tools.log(`File size: ${(fileStats.size / 1024).toFixed(1)}KB`);

View File

@ -517,7 +517,7 @@ tap.test('PDF-09: Corrupted PDF Recovery - Error Reporting Quality', async (tool
tools.log(` Is actionable: ${messageQuality.isActionable}`);
// Error message should be helpful
expect(messageQuality.isDescriptive).toBe(true);
expect(messageQuality.isDescriptive).toBeTrue();
if (messageQuality.containsFileInfo && messageQuality.isActionable) {
tools.log(` ✓ High quality error message`);