How to use the @projectstorm/react-canvas-core.Toolkit.TESTING function in @projectstorm/react-canvas-core

To help you get started, we’ve selected a few @projectstorm/react-canvas-core examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github projectstorm / react-diagrams / packages / react-diagrams-core / src / entities / port / PortWidget.tsx View on Github external
getExtraProps() {
		if (Toolkit.TESTING) {
			const links = _.keys(this.props.port.getNode().getPort(this.props.port.getName()).links).join(',');
			return {
				'data-links': links
			};
		}
		return {};
	}
github projectstorm / react-diagrams / packages / diagrams-demo-gallery / index.tsx View on Github external
import * as React from 'react';
import { storiesOf, addParameters, addDecorator } from '@storybook/react';
import { setOptions } from '@storybook/addon-options';
import { themes } from '@storybook/theming';
import './demos/helpers/index.css';
import { Toolkit } from '@projectstorm/react-canvas-core';

Toolkit.TESTING = true;

addParameters({
	options: {
		theme: themes.dark
	}
});

setOptions({
	name: 'STORM React Diagrams',
	url: 'https://github.com/projectstorm/react-diagrams',
	addonPanelInRight: true
});

addDecorator(fn => {
	Toolkit.TESTING_UID = 0;
	return fn();