stepsCompleted:
test_stack_type: auto → detected: backendpackage.json, no Playwright/Cypress config)Tests/TrackingDataImport_TestHarness.vbs) run via cscriptStandalone — source code only; no story/PRD/test-design artifacts exist for this component.
tea_use_playwright_utils: true → Not applicable (no browser/HTTP layer)tea_use_pactjs_utils: true → Not applicable (no service contracts)tea_pact_mcp: mcp → Not applicabletea_browser_automation: auto → Not applicable (script only)Tests/TrackingDataImport_TestHarness.vbs uses LoadFunctions + ExecuteGlobal to extract individual functions from the source and test them in isolation. Current state:
| Function | Status | Test Count |
|---|---|---|
Truncate |
✅ Tested | 2 |
PadLeft |
✅ Tested | 2 |
PadString |
✅ Tested | 3 (including Null input) |
CleanNull |
✅ Tested | 2 |
CompressArray |
✅ Tested | 1 |
TrimLeadingZeros |
✅ Tested | 2 |
PushNonEmptyToBottom |
✅ Tested | 1 |
GetState |
✅ Tested | 2 |
GetCityFromLine |
✅ Tested | 3 (including Null) |
Assign |
⚠️ Loaded, not tested | 0 |
Choice |
⚠️ Loaded, not tested | 0 |
CheckForFiles |
⚠️ Smoke only (empty dir) | 1 |
CheckStringDoesNotHaveForiegnCountries |
❌ Not in harness | 0 |
ValidJcode, GetSetting, CheckStatusFor, CheckForJobsToCass, ValidImportCSV, ConvertCsvToString, SetupKit, ImportCass, ExportMMCsv, RunMailManager, CreateExportForSnailWorks, CreateProofForJurisdiction, createTrackingInfoForKit, ExportInkjetFile, ThereAreCustomOfficeCopyJobsReady, CreateCustomOfficeCopyJobsInKjetFiles, CreateCustomOfficeCopyJobsProofFiles, CheckSnailWorksPurpleEnvelopeExport, CheckSnailWorksTrakingKitExport, Main, InitConfig, ProcessStatus
The import pipeline CheckForFiles → ConvertCsvToString → ValidImportCSV → SetupKit has no automated coverage at any level. This is the path that processes real CSV files into the database. A failure here causes silent data loss or incorrect kit creation. The unit tests below are baseline documentation; they do not protect this pipeline.
Unit (VBScript cscript harness) — only applicable level for this component
| Target | Gap | Test Cases | Note |
|---|---|---|---|
ValidImportCSV |
Import gate — accepts/rejects all incoming files; Chilkat COM likely available in harness | 20-column CSV → True, 19-column → False, 0-column → False | Investigate: harness can CreateObject("Chilkat_9_5_0.Csv") directly |
CheckStringDoesNotHaveForiegnCountries |
Not in harness; pure logic, no COM dependency | clean US address → True, "CANADA" → False, "JAPAN" → False, lowercase "canada" → True (documents case-sensitive behavior) |
Substring test "123 Norway Ave" → True documents assumption that input arrives pre-uppercased |
GetState |
IgnoreCase=False — mixed-case CSV input silently returns no state |
"lansing, mi 48906" → "" (documents real behavior risk) |
Affects downstream CASS processing |
| Target | Case | Expected | Risk Note |
|---|---|---|---|
CheckStringDoesNotHaveForiegnCountries |
Null input | type mismatch (documents crash) | InStr(Null,x) raises runtime error |
GetState |
Null input | type mismatch | RegExp.Execute(Null) raises type mismatch |
Choice |
Null condition | False branch taken silently | VBScript evaluates If Null Then as False |
| Target | Missing Edge Cases |
|---|---|
TrimLeadingZeros |
"" → "", "abc" → "abc", "0" → "", " 007" (leading space) → " 007", Null → type mismatch |
PadLeft |
exact-length "007" → "007", empty string → "000", Null → type mismatch |
PadString |
longer-than-size "abcde" → "abcde", "" → " " |
CompressArray |
all-empty array, all-non-empty array, single-element array |
GetState |
"" → "" |
| Target | Test Cases | Note |
|---|---|---|
Assign |
scalar string, scalar number, empty string, zero | 5-line utility; tests are baseline documentation only |
Choice |
True branch, False branch, computed True/False | Calls Assign; tests document expected delegation |
CheckForFiles deeper |
Requires Chilkat CSV COM for valid-file path | Skip unless ValidImportCSV Chilkat investigation succeeds |
ValidImportCSV is the import gate — every CSV import decision flows through it. Its column-count check (NumColumns = 20) is testable if Chilkat_9_5_0.Csv can be instantiated in the harness via CreateObject. CheckStringDoesNotHaveForiegnCountries and GetState document real behavior risks around case sensitivity and substring matching in production CSV data. Assign/Choice are downgraded to P2 — baseline documentation, not safety-critical coverage.
Tests/TrackingDataImport_TestHarness.vbs — updated in-place (VBScript harness pattern, no new files required)
New globals added:
Dim objCSV — makes Chilkat CSV available to ValidImportCSVSet objFSO = fso — ensures objFSO is set early for loaded functionsDim chilkatAvailable + COM probe block — skips ValidImportCSV tests gracefully if Chilkat not registeredNew entries in functionNames array:
"CheckStringDoesNotHaveForiegnCountries""ValidImportCSV"New test assertions (38 new tests):
| Priority | Function | Cases |
|---|---|---|
| P0 | CheckStringDoesNotHaveForiegnCountries |
7 (clean US, CANADA, JAPAN, Norway Ave, lowercase canada, empty, Null) |
| P0 | GetState |
2 (lowercase miss, empty) |
| P0 | Choice |
1 (Null condition) |
| P0 | ValidImportCSV |
3 (20-col accept, 19-col reject, empty reject) — conditional on Chilkat |
| P1 | TrimLeadingZeros |
4 (empty, non-numeric, single zero, leading space) |
| P1 | PadLeft |
2 (exact length, empty string) |
| P1 | PadString |
2 (longer-than-size, empty string) |
| P1 | CompressArray |
3 (all-empty, all-non-empty, single-element) |
| P2 | Assign |
4 (string, number, empty, zero) |
| P2 | Choice |
4 (True, False, computed True, computed False) |
Total new tests: 32 (+ 3 conditional on Chilkat availability = 35 max)
| Count | |
|---|---|
| Existing tests (before this pass) | 19 |
| New tests added | 32 (+3 conditional) |
| Total (Chilkat available) | 54 |
| Total (Chilkat unavailable) | 51 |
All applicable items passed. Full checklist adapted for VBScript cscript harness (Playwright/TypeScript items marked N/A).
Key verifications:
Choice(Null, "yes", "no") → "no" confirmed: VBScript If Null Then evaluates FalseCheckStringDoesNotHaveForiegnCountries(Null) → True confirmed: InStr(Null, x) returns Null (falsy in If)ValidImportCSV guard pattern correct: chilkatAvailable flag skips gracefully if COM absentDim declarations satisfy Option Explicit requirementValidImportCSV tests depend on Chilkat_9_5_0.Csv COM registration on the machine running the harness. The guard skips them cleanly if absent.CheckForFiles → ConvertCsvToString → ValidImportCSV → SetupKit) remains without automated coverage — this is the highest actual risk. Database-backed integration tests would require a seeded MDB fixture and are out of scope for the cscript harness pattern.CheckStringDoesNotHaveForiegnCountries substring and case-sensitivity tests are behavior-documentation tests, not defect tests. They document the assumption that upstream CSV data arrives pre-uppercased.GetState lowercase test documents a known production risk: mixed-case city/state lines in real CSV data silently return no state.cscript Tests\TrackingDataImport_TestHarness.vbs
Expected output (Chilkat available): Passed: 54, Failed: 0
Expected output (Chilkat unavailable): SKIP: ValidImportCSV... then Passed: 51, Failed: 0
/bmad-tea-bmad-testarch-test-review — review coverage quality and identify remaining gapsCheckForFiles → SetupKit pipeline using a disposable MDB copy (highest actual risk, currently uncovered)Powered by TurnKey Linux.