Merge pull request #105 from catchonme/master

更新测试用例
This commit is contained in:
liaoxuezhi 2019-07-12 15:07:49 +08:00 committed by GitHub
commit b539308116
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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;
}