更新测试用例

This commit is contained in:
catchonme 2019-07-12 13:42:31 +08:00
parent 25551de1d0
commit 09c427854c
4 changed files with 11 additions and 3 deletions

View File

@ -46,7 +46,7 @@ exports[`Renderer:date 1`] = `
<span
class="a-DatePicker-value"
>
2019-06-06 21:11
2019-06-06 21:11:00
</span>
<a
class="a-DatePicker-clear"

View File

@ -30,7 +30,7 @@ test('Renderer:date', async () => {
})));
const input = container.querySelector('.a-DatePicker-value');
expect(input.innerHTML).toEqual('2019-06-06 21:11');
expect(input.innerHTML).toEqual('2019-06-06 21:11:00');
expect(container).toMatchSnapshot();
});

View File

@ -4,10 +4,10 @@ exports[`Renderer:carousel 1`] = `
<div>
<div
class="a-Carousel a-Carousel--light show"
style="width: 500px; height: 300px;"
>
<div
class="a-Carousel-container"
style="width: 500px; height: 300px;"
>
<div
class="a-Carousel-item fade in"

View File

@ -420,6 +420,14 @@ class SchemaRenderer extends React.Component<SchemaRendererProps, any> {
delete schema.$ref;
path = path.replace(/(?!.*\/).*/, schema.type);
}
// value 会提前从 control 中获取到所有需要把control中的属性也补充完整
if (schema.control && schema.control.$ref) {
schema.control = {
...props.resolveDefinitions(schema.control.$ref),
...schema.control
}
delete schema.control.$ref;
}
this.renderer = rendererResolver(path, schema, props);
return schema;
}