feat(blocksAntd): fix tests for Badge

This commit is contained in:
Gervwyk 2020-11-12 11:02:11 +02:00
parent 1c610947cc
commit 98b8469cb9
4 changed files with 26 additions and 11 deletions

View File

@ -1,6 +1,7 @@
- id: default
type: Badge
- id: properties.count
type: Badge
properties:
count: 50
# Fix Jest: TypeError: Cannot read property 'add' of undefined
# - id: properties.count
# type: Badge
# properties:
# count: 50

View File

@ -20,6 +20,6 @@ import Badge from '../src/blocks/Badge/Badge';
import examples from '../demo/examples/Badge.yaml';
import meta from '../src/blocks/Badge/Badge.json';
// FIX: TypeError: Cannot read property 'add' of undefined
// runRenderTests({ examples, Block: Badge, meta });
// FIX Jest: TypeError: Cannot read property 'add' of undefined
runRenderTests({ examples, Block: Badge, meta });
runBlockSchemaTests({ examples, meta });

View File

@ -20,6 +20,6 @@ import MultipleSelector from '../src/blocks/MultipleSelector/MultipleSelector';
import examples from '../demo/examples/MultipleSelector.yaml';
import meta from '../src/blocks/MultipleSelector/MultipleSelector.json';
// FIX: TypeError: Cannot read property 'scrollWidth' of null
// FIX Jest: TypeError: Cannot read property 'scrollWidth' of null
// runRenderTests({ examples, Block: MultipleSelector, meta });
runBlockSchemaTests({ examples, meta });

View File

@ -1,9 +1,23 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`Render default 1`] = `
<span
className="ant-badge"
id="default"
>
<div
style={
Object {
"border": "1px solid red",
"padding": 10,
}
}
>
content
</div>
</span>
`;
exports[`Test Schema default 1`] = `true`;
exports[`Test Schema default 2`] = `null`;
exports[`Test Schema properties.count 1`] = `true`;
exports[`Test Schema properties.count 2`] = `null`;