Added robust serial validation with support for multiple formats: - Production format: WELLNUO-XXXX-XXXX (strict validation) - Demo serials: DEMO-00000 and DEMO-1234-5678 - Legacy format: 8+ alphanumeric characters with hyphens Frontend improvements (activate.tsx): - Real-time validation feedback with error messages - Visual error indicators (red border, error icon) - Proper normalization (uppercase, trimmed) - Better user experience with clear error messages Backend improvements (beneficiaries.js): - Enhanced serial validation on activation endpoint - Stores normalized serial in device_id field - Better logging for debugging - Consistent error responses with validation details Testing: - 52 frontend tests covering all validation scenarios - 40 backend tests ensuring consistency - Edge case handling (long serials, special chars, etc.) Code quality: - ESLint configuration for test files - All tests passing - Zero linting errors
13 lines
257 B
JavaScript
13 lines
257 B
JavaScript
module.exports = {
|
|
extends: ['expo', 'prettier'],
|
|
plugins: ['prettier'],
|
|
overrides: [
|
|
{
|
|
files: ['**/__tests__/**/*', '**/*.test.ts', '**/*.test.tsx', '**/*.test.js', '**/*.test.jsx'],
|
|
env: {
|
|
jest: true,
|
|
},
|
|
},
|
|
],
|
|
};
|