Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
it('validates non-numeric values in integer field', () => {
var ResponseFieldInstance = TestUtils.renderIntoDocument(
);
var input = TestUtils.findRenderedDOMComponentWithTag(ResponseFieldInstance, 'input');
// simulate changing input
TestUtils.Simulate.change(
input,
{
target: {
setCustomValidity: setCustomValidity,
value: 'a'
}
}
);
it('uses the initial value for the left offset', () => {
// Test elements don't actually get rendered so all of the offsets are 0.
const root = renderIntoDocument();
root.animateLeft = 100;
root.setIconPosition();
expect(root.animateIcon.style.transform).toEqual('translateX(-100px)');
});
it('onClick', () => {
const component = TestUtils.renderIntoDocument(
<div>
</div>
);
const buttons = component.querySelectorAll('.hover-menu__item');
[...buttons].forEach((item, index) => {
TestUtils.Simulate.click(item);
expect(baseProps.onUpdateMessageStatus).toBeCalledWith({
id: baseProps.id,
oper: actionNames[index]
});
});
});
});
it('隐藏提交按钮', () => {
let mockColumnsModel;
let mockDefaultData;
mockColumnsModel = [
{type: 'string', id: 'name', label: '名称'},
{type: 'string', id: 'code', label: '编码'}
];
mockDefaultData = { id: '0', name: 'n1', code: 'c1' };
const component = ReactTestUtils.renderIntoDocument(
<form>
);
const component2 = ReactTestUtils.renderIntoDocument(
);
const component3 = ReactTestUtils.renderIntoDocument(
</form>
test("Renderer: Chart grid XY", function(t) {
//t.plan(6);
var rw = TU.renderIntoDocument(
);
var svg = TU.findRenderedDOMComponentWithTag(
rw,
"svg"
);
t.ok(TU.isDOMComponent(svg), "svg rendered to DOM");
it(`should have correct size`, () => {
const props = {
ItemComponent: ItemComponentMock,
itemWidth: rndoam.number(),
itemHeight: rndoam.number()
}
const tree = TestUtils.renderIntoDocument(
)
const divs = TestUtils.scryRenderedDOMComponentsWithTag(tree, `div`)
expect(divs[0].style.width).toEqual(`${props.itemWidth}px`)
expect(divs[0].style.height).toEqual(`${props.itemHeight}px`)
})
it('it has the right class for anything other than error', function () {
notice = {
type: 'success',
text: 'Some text',
icon: 'search'
};
component = TestUtils.renderIntoDocument();
assert.lengthOf(TestUtils.scryRenderedDOMComponentsWithClass(component, 'icon'), 1);
assert.match(TestUtils.findRenderedDOMComponentWithClass(component, 'icon').className, '-search');
});
});
it('infers margin from children margin props', () => {
const props = {
width, height,
scaleType: {x: 'linear', y: 'linear'},
domain: {x: [-50, 50], y: [-100, 100]}
};
const tree =
;
const wrapped = TestUtils.renderIntoDocument(tree);
const rendered = TestUtils.findRenderedComponentWithType(wrapped, ContainerChart);
expectXYScaledComponent(rendered, {margin: {top: 20, bottom: 40, left: 30, right: 50}, ...props});
});
beforeEach(() => {
root = TestUtils.renderIntoDocument(
)
flex = TestUtils.findRenderedDOMComponentWithClass(root, 'Flex')
computed = flex.style
})
beforeEach(done => {
renderedTest = TestUtils.renderIntoDocument();
renderedTest.setState({ value: past }, done);
});