Android CI / RC / Android · lint, tests, debug APK, release compile (push) Successful in 3m17s
DH V2 CI / API · typecheck, tests, build (push) Successful in 35s
DH V2 CI / WEB · typecheck, build (push) Successful in 20s
Production dependency audit / API · production dependencies (push) Successful in 9s
Production dependency audit / WEB · production dependencies (push) Successful in 9s
DH V2 CI / Docker / scripts contract (push) Successful in 1m7s
32 lines
1.6 KiB
TypeScript
32 lines
1.6 KiB
TypeScript
import assert from 'node:assert/strict';
|
|
import { readFileSync } from 'node:fs';
|
|
import { resolve } from 'node:path';
|
|
import test from 'node:test';
|
|
|
|
function source(path: string): string {
|
|
return readFileSync(resolve(process.cwd(), path), 'utf8');
|
|
}
|
|
|
|
test('F6.5 finding code CHECK accepts the current visible Acta code', () => {
|
|
const migration = source('src/database/migrations/1790121000000-f6-5-field-finding-code-contract.ts');
|
|
const service = source('src/inspection-findings/inspection-findings.service.ts');
|
|
|
|
assert.match(migration, /ACT-\[0-9\]\{5\}-\[0-9\]\{2\}-\[0-9\]\{2\}-\[0-9\]\{2\}/);
|
|
assert.match(migration, /-H\[0-9\]\{3\}/);
|
|
assert.match(service, /code: `\$\{act\.code\}-H\$\{String\(findingNumber\)\.padStart\(3, '0'\)\}`/);
|
|
});
|
|
|
|
test('F6.5 mobile finding creation never asks the inspector for a correction date', () => {
|
|
const dto = source('src/inspection-visits/dto/create-field-finding.dto.ts');
|
|
const adapter = source('src/inspection-visits/field-findings.service.ts');
|
|
const androidRequest = source('../android-app/app/src/main/java/com/korexlabs/dhinspeccion/data/FieldFindingsMobile.kt');
|
|
const androidScreen = source('../android-app/app/src/main/java/com/korexlabs/dhinspeccion/ui/FieldFindingScreen.kt');
|
|
|
|
assert.doesNotMatch(dto, /correctionDueOn/);
|
|
assert.match(adapter, /correctionDueOn: null/);
|
|
assert.doesNotMatch(androidRequest.match(/data class CreateFieldFindingRequest\([\s\S]*?\n\)/)?.[0] ?? '', /correctionDueOn/);
|
|
assert.doesNotMatch(androidScreen, /Fecha de corrección/);
|
|
assert.match(androidScreen, /ExposedDropdownMenuBox/);
|
|
assert.match(androidScreen, /Tipo de Hallazgo \*/);
|
|
});
|