import { Align } from './align'; import { Adsorber } from './adsorber'; import { Rectangle } from '@gedit/math'; import * as chai from 'chai'; const expect = chai.expect; describe('Playground.Align', () => { const target: Rectangle = new Rectangle(0, 0, 50, 50); it ('calculate diff', () => { const refs: Rectangle[] = [ new Rectangle(1040, 1040, 20, 20) ]; expect(Align.calculate(target, refs, [])).to.eql([]); }); it('calculate ref', () => { const refs: Rectangle[] = [ new Rectangle(0, 500, 20, 30) ]; expect(Align.calculate(target, refs, [])).to.eql([ { direction: Adsorber.Direction.VERTICAL, startPos: { x: 0, y: 0 }, endPos: { x: 0, y: 530 }, type: 0, } ]); }); });