Fix SMS classifier test mock: add defaultScores and metadataLimits exports (FRE-4509)
The test mock for spamshield.config was missing defaultScores and metadataLimits exports that are imported by spamshield.service.ts, causing 8 tests to fail with 'No defaultScores export is defined'.
This commit is contained in:
@@ -35,6 +35,31 @@ vi.mock('../services/spamshield/spamshield.config', () => ({
|
|||||||
VERY_HIGH: 'very_high',
|
VERY_HIGH: 'very_high',
|
||||||
},
|
},
|
||||||
spamRateLimits: {},
|
spamRateLimits: {},
|
||||||
|
defaultScores: {
|
||||||
|
defaultReputationConfidence: 0.0,
|
||||||
|
defaultReputationLowConfidence: 0.1,
|
||||||
|
defaultBaseConfidence: 0.5,
|
||||||
|
defaultMaxConfidence: 1.0,
|
||||||
|
featureWeights: {
|
||||||
|
urlPresent: 0.1,
|
||||||
|
highEmojiDensity: 0.15,
|
||||||
|
urgencyKeyword: 0.2,
|
||||||
|
excessiveCaps: 0.15,
|
||||||
|
},
|
||||||
|
defaultSpamScore: 0.0,
|
||||||
|
highReputationThreshold: 0.7,
|
||||||
|
reputationWeightInCombinedScore: 0.4,
|
||||||
|
shortDurationScore: 0.2,
|
||||||
|
voipScore: 0.15,
|
||||||
|
unusualHoursScore: 0.1,
|
||||||
|
hiyaWeightInCombinedScore: 0.7,
|
||||||
|
truecallerWeightInCombinedScore: 0.3,
|
||||||
|
},
|
||||||
|
metadataLimits: {
|
||||||
|
maxMetadataSizeBytes: 4096,
|
||||||
|
maxMetadataKeys: 20,
|
||||||
|
maxMetadataValueSizeBytes: 512,
|
||||||
|
},
|
||||||
}));
|
}));
|
||||||
|
|
||||||
describe('SMSClassifierService', () => {
|
describe('SMSClassifierService', () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user