mirror of
https://github.com/sartography/bpmn-js.git
synced 2025-01-31 03:04:49 +00:00
d3449ca87c
* use ES6 import / export * UTILS: export individual utilities * TESTS: localize TestHelper includes BREAKING CHANGE: * all utilities export independent functions * library sources got ported to ES6. You must now use a ES module bundler such as Browserify + babelify or Webpack to consume this library (or parts of it).
31 lines
787 B
JavaScript
31 lines
787 B
JavaScript
'use strict';
|
|
|
|
import intersection from 'lib/features/modeling/behavior/util/LineIntersect';
|
|
|
|
|
|
describe('modeling/behavior/util - LineIntersect', function() {
|
|
|
|
it('should compute intersections', function() {
|
|
expect(intersection(
|
|
{ x: 10, y: 20 }, { x: 50, y: 50 },
|
|
{ x: 10, y: 50 }, { x: 50, y: 50 }
|
|
)).to.eql({ x: 50, y: 50 });
|
|
|
|
expect(intersection(
|
|
{ x: 10, y: 20 }, { x: 10, y: 50 },
|
|
{ x: 10, y: 50 }, { x: 50, y: 50 }
|
|
)).to.eql({ x: 10, y: 50 });
|
|
|
|
expect(intersection(
|
|
{ x: 50, y: 50 }, { x: 10, y: 40 },
|
|
{ x: 10, y: 50 }, { x: 50, y: 50 }
|
|
)).to.eql({ x: 50, y: 50 });
|
|
|
|
expect(intersection(
|
|
{ x: 0, y: 0 }, { x: 100, y: 100 },
|
|
{ x: 40, y: 0 }, { x: 30, y: 10 }
|
|
)).to.eql({ x: 20, y: 20 });
|
|
|
|
});
|
|
|
|
}); |