test(android): lock F5 test APK contract

This commit is contained in:
2026-09-08 23:26:49 -03:00
parent 5c78aee5e9
commit 4dce65d577
@@ -0,0 +1,32 @@
import assert from 'node:assert/strict';
import { readFileSync } from 'node:fs';
import { resolve } from 'node:path';
import test from 'node:test';
function repoFile(path: string): string {
return readFileSync(resolve(process.cwd(), '..', path), 'utf8');
}
test('F5 Android test cut targets production API and has a distinct installable debug version', () => {
const gradle = repoFile('android-app/app/build.gradle.kts');
const workflow = repoFile('.github/workflows/android.yml');
assert.match(gradle, /versionCode = 20/);
assert.match(gradle, /versionName = "0\.13\.0"/);
assert.match(gradle, /https:\/\/dhv2\.korexlabs\.com\/api\/v3\//);
assert.match(gradle, /applicationIdSuffix = "\.debug"/);
assert.match(workflow, /DH-Inspeccion-F5-0\.13\.0-debug/);
assert.match(workflow, /:app:assembleDebug/);
assert.match(workflow, /:app:testDebugUnitTest/);
});
test('F5 field inventory exposes Other families as reviewable choices to Android', () => {
const service = readFileSync(
resolve(process.cwd(), 'src/inspection-visits/f3-field-inventory-structure.service.ts'),
'utf8',
);
assert.match(service, /F5:SYSTEM:OTHER:%/);
assert.match(service, /AS "isOther"/);
assert.match(service, /isOtherFamily: family\.isOther/);
});