Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
.then(request => {
assert.equal(streamHelper.streamCount, 2);
assert.notEqual(oldRequestStream, streamHelper.writeStream);
assert.deepStrictEqual(collQueryJSON(), request);
watchHelper.sendAddTarget();
watchHelper.sendCurrent();
watchHelper.sendSnapshot(3);
return watchHelper.await('snapshot');
})
.then(results => {
it('should call onDrag when dragging', () => {
const onDrag = sinon.spy();
const resizeAndMovable = ReactDOM.render(
,
document.querySelector('body > div')
);
const node = ReactDOM.findDOMNode(resizeAndMovable);
TestUtils.Simulate.mouseDown(node, { clientX: 0, clientY: 0 });
mouseMove(100, 120);
mouseUp(100, 120);
const style = node.getAttribute('style');
assert.equal(onDrag.callCount, 1);
assert.equal(onDrag.getCall(0).args[1].position.left, 100);
assert.equal(onDrag.getCall(0).args[1].position.top, 120);
assert.notEqual(style.indexOf('transform: translate(100px, 120px);'), -1);
});
moxios.wait(() => {
let response = onFulfilled.getCall(0).args[0];
equal(response.status, 204);
let request = moxios.requests.get('PUT', '/users/12345');
notEqual(request, undefined);
done();
});
});
it('should install', () => {
let defaultAdapter = axios.defaults.adapter;
moxios.install();
notEqual(axios.defaults.adapter, defaultAdapter);
moxios.uninstall();
});
moxios.wait(() => {
equal(onFulfilled.calledTwice, true);
let response1 = onFulfilled.getCall(0).args[0];
let response2 = onFulfilled.getCall(1).args[0];
equal(response1.status, 204);
equal(response2.status, 200);
equal(response2.data.firstName, 'Fred');
let request = moxios.requests.get('PUT', '/users/12345');
notEqual(request, undefined);
request = moxios.requests.get('GET', '/users/12346');
notEqual(request, undefined);
done();
});
});
it('should be rendered as div default', () => {
const component = TestUtils.renderIntoDocument();
const node = TestUtils.findRenderedDOMComponentWithTag(component, 'div');
assert.notEqual(node, null);
});
it('should be disposed after unmount', () => {
const component = ReactDOM.render(, div);
assert.notEqual(component.observer, null);
ReactDOM.unmountComponentAtNode(div);
assert.equal(component.observer, null);
});
});