One shell with the current look: indicators, follow-up list and patient view from FHIR; /conectar canvas; /revision; Playwright page tests

This commit is contained in:
Roberto Treviño
2026-11-25 10:21:30 -06:00
parent 70b6d6c646
commit cd7bbaf11a
70 changed files with 5459 additions and 182 deletions
+40
View File
@@ -0,0 +1,40 @@
import { nodeSchema } from './schema-form';
const PIPELINE = {
$defs: {
Position: { type: 'object', properties: { x: { type: 'number' } } },
Condition: { type: 'object', properties: { column: { type: 'string' } } },
Route: {
type: 'object',
additionalProperties: false,
required: ['id', 'when'],
properties: {
id: { type: 'string' },
kind: { const: 'route' },
inputs: { type: 'array' },
position: { anyOf: [{ $ref: '#/$defs/Position' }, { type: 'null' }] },
when: { type: 'array', items: { $ref: '#/$defs/Condition' } },
resource: { anyOf: [{ type: 'string' }, { type: 'null' }], title: 'Resource' },
values: { type: 'object', additionalProperties: { type: 'string' }, title: 'Values' },
},
},
},
} as never;
describe('node forms from the pipeline schema', () => {
const schema = nodeSchema(PIPELINE, 'route') as any;
it('leaves out what the canvas edits', () => {
expect(Object.keys(schema.properties)).toEqual(['when', 'resource', 'values']);
expect(schema.required).toEqual(['when']);
});
it('inlines references and drops null from optional values', () => {
expect(schema.properties.when.items.properties.column.type).toBe('string');
expect(schema.properties.resource.type).toBe('string');
});
it('edits maps as JSON', () => {
expect(schema.properties.values.widget.formlyConfig.type).toBe('json');
});
});