feat(tests): fully implemented test suite
This commit is contained in:
@ -93,7 +93,7 @@ tap.test('VAL-09: Semantic Level Validation - Date Format Validation', async (to
|
||||
if (test.valid) {
|
||||
expect(parseResult).toBeTruthy();
|
||||
const validationResult = await invoice.validate();
|
||||
expect(validationResult.valid).toBe(true);
|
||||
expect(validationResult.valid).toBeTrue();
|
||||
tools.log(`✓ Valid date '${test.value}' accepted`);
|
||||
} else {
|
||||
// Should either fail parsing or validation
|
||||
@ -232,7 +232,7 @@ tap.test('VAL-09: Semantic Level Validation - Cross-Field Dependencies', async (
|
||||
const validationResult = await invoice.validate();
|
||||
|
||||
if (test.valid) {
|
||||
expect(validationResult.valid).toBe(true);
|
||||
expect(validationResult.valid).toBeTrue();
|
||||
tools.log(`✓ ${test.name}: Valid cross-field dependency accepted`);
|
||||
} else {
|
||||
expect(validationResult.valid).toBe(false);
|
||||
|
@ -84,7 +84,7 @@ tap.test('VAL-10: Business Level Validation - Invoice Totals Consistency', async
|
||||
const validationResult = await invoice.validate();
|
||||
|
||||
if (test.valid) {
|
||||
expect(validationResult.valid).toBe(true);
|
||||
expect(validationResult.valid).toBeTrue();
|
||||
tools.log(`✓ ${test.name}: Valid business logic accepted`);
|
||||
} else {
|
||||
expect(validationResult.valid).toBe(false);
|
||||
@ -343,7 +343,7 @@ tap.test('VAL-10: Business Level Validation - Business Rules Compliance', async
|
||||
const validationResult = await invoice.validate();
|
||||
|
||||
if (test.valid) {
|
||||
expect(validationResult.valid).toBe(true);
|
||||
expect(validationResult.valid).toBeTrue();
|
||||
tools.log(`✓ ${test.name}: Business rule compliance verified`);
|
||||
} else {
|
||||
expect(validationResult.valid).toBe(false);
|
||||
|
@ -61,7 +61,7 @@ tap.test('VAL-11: Custom Validation Rules - Invoice Number Format Rules', async
|
||||
const isValid = rule.pattern.test(testValue.value);
|
||||
|
||||
if (testValue.valid) {
|
||||
expect(isValid).toBe(true);
|
||||
expect(isValid).toBeTrue();
|
||||
tools.log(`✓ Valid format '${testValue.value}' accepted by ${rule.name}`);
|
||||
} else {
|
||||
expect(isValid).toBe(false);
|
||||
@ -150,7 +150,7 @@ tap.test('VAL-11: Custom Validation Rules - Supplier Registration Validation', a
|
||||
}
|
||||
|
||||
if (test.valid) {
|
||||
expect(isValidVAT).toBe(true);
|
||||
expect(isValidVAT).toBeTrue();
|
||||
tools.log(`✓ ${test.name}: Valid VAT number accepted`);
|
||||
} else {
|
||||
expect(isValidVAT).toBe(false);
|
||||
@ -239,7 +239,7 @@ tap.test('VAL-11: Custom Validation Rules - Industry-Specific Rules', async (too
|
||||
}
|
||||
|
||||
if (test.valid) {
|
||||
expect(passesIndustryRules).toBe(true);
|
||||
expect(passesIndustryRules).toBeTrue();
|
||||
tools.log(`✓ ${test.name}: Industry rule compliance verified`);
|
||||
} else {
|
||||
expect(passesIndustryRules).toBe(false);
|
||||
@ -340,7 +340,7 @@ tap.test('VAL-11: Custom Validation Rules - Payment Terms Constraints', async (t
|
||||
}
|
||||
|
||||
if (test.valid) {
|
||||
expect(passesPaymentRules).toBe(true);
|
||||
expect(passesPaymentRules).toBeTrue();
|
||||
tools.log(`✓ ${test.name}: Payment terms validation passed`);
|
||||
} else {
|
||||
expect(passesPaymentRules).toBe(false);
|
||||
@ -439,7 +439,7 @@ tap.test('VAL-11: Custom Validation Rules - Document Sequence Validation', async
|
||||
}
|
||||
|
||||
if (test.valid) {
|
||||
expect(passesSequenceRules).toBe(true);
|
||||
expect(passesSequenceRules).toBeTrue();
|
||||
tools.log(`✓ ${test.name}: Document sequence validation passed`);
|
||||
} else {
|
||||
expect(passesSequenceRules).toBe(false);
|
||||
|
Reference in New Issue
Block a user