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:
@@ -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');
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user