From ab0112000a956e3fe52e5b990580702d217120bb Mon Sep 17 00:00:00 2001 From: Nico Rehwaldt Date: Tue, 12 Mar 2024 15:53:01 +0100 Subject: [PATCH] chore(test): import explicit files This prepares us to migrate diagram-js to an ES module. Related to https://github.com/bpmn-io/diagram-js/issues/863 --- test/TestHelper.js | 8 ++--- test/matchers/BoundsMatchers.js | 8 ++--- test/matchers/BoundsMatchersSpec.js | 2 +- test/matchers/ConnectionMatchers.js | 2 +- test/matchers/ConnectionMatchersSpec.js | 2 +- test/spec/command/CommandInterceptorSpec.js | 10 +++--- test/spec/command/CommandStackSpec.js | 4 +-- .../ConnectionPreviewSpec.js | 25 ++++++++------- test/spec/core/CanvasSpec.js | 18 +++++------ test/spec/core/ElementRegistrySpec.js | 2 +- test/spec/core/EventBusSpec.js | 2 +- test/spec/core/GraphicsFactorySpec.js | 10 +++--- test/spec/draw/DefaultRendererSpec.js | 7 ++-- test/spec/draw/StylesSpec.js | 2 +- test/spec/environment/MockingSpec.js | 5 ++- .../align-elements/AlignElementsSpec.js | 12 +++---- .../align-elements/rules/TestRules.js | 2 +- .../features/align-elements/rules/index.js | 2 +- .../attach-support/AttachSupportSpec.js | 31 +++++++++--------- .../attach-support/rules/AttachRules.js | 5 +-- .../features/attach-support/rules/index.js | 2 +- .../spec/features/auto-place/AutoPlaceSpec.js | 20 ++++++------ .../features/auto-resize/AutoResizeSpec.js | 20 ++++++------ .../features/auto-scroll/AutoScrollSpec.js | 8 ++--- .../features/bendpoints/BendpointsMoveSpec.js | 32 +++++++++---------- .../features/bendpoints/BendpointsSpec.js | 24 +++++++------- .../bendpoints/ConnectionSegmentMoveSpec.js | 18 +++++------ .../features/bendpoints/GeometricUtilSpec.js | 2 +- .../bendpoints/rules/BendpointRules.js | 2 +- test/spec/features/bendpoints/rules/index.js | 2 +- .../change-support/ChangeSupportSpec.js | 6 ++-- test/spec/features/clipboard/ClipboardSpec.js | 4 +-- .../complex-preview/ComplexPreviewSpec.js | 17 +++++----- test/spec/features/connect/ConnectSpec.js | 22 ++++++------- .../features/connect/rules/ConnectRules.js | 4 +-- test/spec/features/connect/rules/index.js | 2 +- .../features/context-pad/ContextPadSpec.js | 28 ++++++++-------- .../spec/features/copy-paste/CopyPasteSpec.js | 26 +++++++-------- .../copy-paste/rules/CopyPasteRules.js | 2 +- test/spec/features/copy-paste/rules/index.js | 2 +- .../spec/features/create/CreatePreviewSpec.js | 23 ++++++------- test/spec/features/create/CreateSpec.js | 27 ++++++++-------- .../spec/features/create/rules/CreateRules.js | 2 +- test/spec/features/create/rules/index.js | 2 +- .../DistributeElementsSpec.js | 12 +++---- .../distribute-elements/rules/TestRules.js | 2 +- .../distribute-elements/rules/index.js | 2 +- test/spec/features/dragging/DraggingSpec.js | 22 ++++++------- .../editor-actions/EditorActionsSpec.js | 18 +++++------ .../editor-actions/rules/CustomRules.js | 2 +- .../features/editor-actions/rules/index.js | 2 +- .../global-connect/GlobalConnectSpec.js | 10 +++--- .../rules/GlobalConnectRules.js | 2 +- .../features/global-connect/rules/index.js | 2 +- .../grid-snapping/GridSnappingSpec.js | 26 +++++++-------- .../behavior/ResizeBehaviorSpec.js | 17 +++++----- .../behavior/SpaceToolBehaviorSpec.js | 12 +++---- test/spec/features/hand-tool/HandToolSpec.js | 21 ++++++------ test/spec/features/hover-fix/HoverFixSpec.js | 12 +++---- .../InteractionEventsSpec.js | 14 ++++---- .../KeyboardMoveSelectionSpec.js | 16 +++++----- .../rules/KeyboardMoveRules.js | 5 +-- .../keyboard-move-selection/rules/index.js | 2 +- test/spec/features/keyboard/CopySpec.js | 20 ++++++------ test/spec/features/keyboard/KeyboardSpec.js | 12 +++---- test/spec/features/keyboard/PasteSpec.js | 20 ++++++------ test/spec/features/keyboard/RedoSpec.js | 18 +++++------ .../features/keyboard/RemoveSelectionSpec.js | 18 +++++------ test/spec/features/keyboard/UndoSpec.js | 18 +++++------ test/spec/features/keyboard/ZoomSpec.js | 17 +++++----- .../label-support/LabelSupportSpec.js | 22 ++++++------- .../label-support/rules/LabelSupportRules.js | 3 +- .../features/label-support/rules/index.js | 2 +- .../spec/features/lasso-tool/LassoToolSpec.js | 18 +++++------ .../spec/features/modeling/AppendShapeSpec.js | 13 ++++---- .../features/modeling/CreateConnectionSpec.js | 4 +-- .../features/modeling/CreateElementsSpec.js | 14 ++++---- .../spec/features/modeling/CreateLabelSpec.js | 4 +-- .../spec/features/modeling/CreateShapeSpec.js | 4 +-- .../features/modeling/DeleteConnectionSpec.js | 4 +-- .../features/modeling/DeleteElementsSpec.js | 4 +-- .../spec/features/modeling/DeleteShapeSpec.js | 8 ++--- test/spec/features/modeling/DropShapeSpec.js | 4 +-- .../features/modeling/LayoutConnectionSpec.js | 6 ++-- .../features/modeling/MoveConnectionSpec.js | 4 +-- .../features/modeling/MoveElementsSpec.js | 12 +++---- test/spec/features/modeling/MoveShapeSpec.js | 4 +-- .../modeling/ReconnectConnectionSpec.js | 4 +-- .../features/modeling/ReplaceShapeSpec.js | 4 +-- .../spec/features/modeling/ResizeShapeSpec.js | 30 ++++++++--------- .../modeling/ToggleShapeCollapseSpec.js | 4 +-- .../features/modeling/UpdateAttachmentSpec.js | 4 +-- .../modeling/custom/CustomLayouter.js | 4 +-- test/spec/features/modeling/custom/index.js | 12 +++---- test/spec/features/mouse/MouseSpec.js | 6 ++-- test/spec/features/move/MovePreviewSpec.js | 30 ++++++++--------- test/spec/features/move/MoveSpec.js | 18 +++++------ test/spec/features/move/rules/MoveRules.js | 5 +-- test/spec/features/move/rules/index.js | 2 +- .../features/ordering/OrderingProviderSpec.js | 8 ++--- .../ordering/provider/TestOrderingProvider.js | 4 +-- test/spec/features/ordering/provider/index.js | 2 +- test/spec/features/outline/OutlineSpec.js | 14 ++++---- .../overlays/OverlaysIntegrationSpec.js | 30 ++++++++--------- test/spec/features/overlays/OverlaysSpec.js | 14 ++++---- test/spec/features/palette/PaletteSpec.js | 24 +++++++------- .../popup-menu/PopupMenuComponentSpec.js | 6 ++-- .../features/popup-menu/PopupMenuItemSpec.js | 11 ++++--- .../features/popup-menu/PopupMenuListSpec.js | 12 +++---- .../spec/features/popup-menu/PopupMenuSpec.js | 29 +++++++++-------- .../renderer/MarkerRenderer.js | 6 ++-- .../preview-support/renderer/index.js | 2 +- .../replace/ReplaceSelectionBehaviorSpec.js | 6 ++-- test/spec/features/replace/ReplaceSpec.js | 8 ++--- test/spec/features/resize/ResizeSpec.js | 32 +++++++++---------- test/spec/features/resize/ResizeUtilSpec.js | 3 +- .../spec/features/resize/rules/ResizeRules.js | 3 +- test/spec/features/resize/rules/index.js | 2 +- .../root-elements/RootElementsBehaviorSpec.js | 10 +++--- test/spec/features/rules/RuleProviderSpec.js | 18 +++++------ .../rules/priority-rules/PriorityRules.js | 2 +- .../features/rules/priority-rules/index.js | 2 +- test/spec/features/rules/rules/TestRules.js | 2 +- test/spec/features/rules/rules/index.js | 2 +- .../features/rules/say-no-rules/SayNoRules.js | 2 +- .../spec/features/rules/say-no-rules/index.js | 2 +- .../spec/features/search-pad/SearchPadSpec.js | 8 ++--- .../selection/SelectionBehaviorSpec.js | 20 ++++++------ test/spec/features/selection/SelectionSpec.js | 20 ++++++------ .../selection/SelectionVisualsSpec.js | 20 ++++++------ .../features/selection/rules/ConnectRules.js | 2 +- test/spec/features/selection/rules/index.js | 2 +- test/spec/features/snapping/SnappingSpec.js | 8 ++--- .../spec/features/space-tool/SpaceToolSpec.js | 16 +++++----- .../auto-resize/CustomAutoResizeProvider.js | 2 +- .../features/space-tool/auto-resize/index.js | 2 +- .../space-tool/rules/SpaceToolRules.js | 2 +- test/spec/features/space-tool/rules/index.js | 2 +- .../features/tool-manager/ToolManagerSpec.js | 19 +++++++---- test/spec/features/tooltips/TooltipsSpec.js | 12 +++---- test/spec/i18n/I18NSpec.js | 6 ++-- .../custom-translate/custom-translate.js | 2 +- .../i18n/translate/custom-translate/index.js | 2 +- test/spec/i18n/translate/translateSpec.js | 6 ++-- .../layout/CroppingConnectionDockingSpec.js | 4 +-- test/spec/layout/LayoutUtilSpec.js | 2 +- test/spec/layout/ManhattanLayoutSpec.js | 2 +- test/spec/model/ModelSpec.js | 5 +-- .../keyboard-move/KeyboardMoveSpec.js | 18 +++++------ .../navigation/movecanvas/MoveCanvasSpec.js | 14 ++++---- .../navigation/zoomscoll/ZoomScrollSpec.js | 14 ++++---- test/spec/snapping/CreateMoveSnappingSpec.js | 16 +++++----- test/spec/snapping/ResizeSnappingSpec.js | 14 ++++---- test/spec/snapping/SnapContextSpec.js | 2 +- test/spec/snapping/SnapUtilSpec.js | 6 ++-- test/spec/snapping/SnappingSpec.js | 10 +++--- test/spec/ui/uiSpec.js | 2 +- test/spec/util/AttachUtilSpec.js | 2 +- test/spec/util/ElementIntegrationSpec.js | 6 ++-- test/spec/util/ElementsSpec.js | 2 +- test/spec/util/EscapeUtilSpec.js | 2 +- test/spec/util/GeometrySpec.js | 2 +- test/spec/util/IdGeneratorSpec.js | 2 +- test/spec/util/LineIntersectionSpec.js | 2 +- test/spec/util/RenderUtilSpec.js | 2 +- test/spec/util/TextSpec.js | 2 +- test/util/MockEvents.js | 4 +-- 167 files changed, 798 insertions(+), 775 deletions(-) diff --git a/test/TestHelper.js b/test/TestHelper.js index afb6bee2b..73fc37319 100644 --- a/test/TestHelper.js +++ b/test/TestHelper.js @@ -1,8 +1,8 @@ -export * from './helper'; +export * from './helper/index.js'; import { insertCSS -} from './helper'; +} from './helper/index.js'; import diagramCSS from '../assets/diagram-js.css'; @@ -14,8 +14,8 @@ insertCSS('diagram-js-testing.css', ); -import BoundsMatchers from './matchers/BoundsMatchers'; -import ConnectionMatchers from './matchers/ConnectionMatchers'; +import BoundsMatchers from './matchers/BoundsMatchers.js'; +import ConnectionMatchers from './matchers/ConnectionMatchers.js'; /* global chai */ diff --git a/test/matchers/BoundsMatchers.js b/test/matchers/BoundsMatchers.js index 6b765184b..06b9aee57 100644 --- a/test/matchers/BoundsMatchers.js +++ b/test/matchers/BoundsMatchers.js @@ -1,10 +1,10 @@ import { pick } from 'min-dash'; /** - * @typedef {import('../../lib/util/Types').Dimensions} Dimensions - * @typedef {import('../../lib/util/Types').Point} Point - * @typedef {import('../../lib/util/Types').Rect} Rect - * @typedef {import('../../lib/util/Types').RectTRBL} RectTRBL + * @typedef {import('../../lib/util/Types.js').Dimensions} Dimensions + * @typedef {import('../../lib/util/Types.js').Point} Point + * @typedef {import('../../lib/util/Types.js').Rect} Rect + * @typedef {import('../../lib/util/Types.js').RectTRBL} RectTRBL */ var BOUNDS_ATTRS = [ 'x', 'y', 'width', 'height' ], diff --git a/test/matchers/BoundsMatchersSpec.js b/test/matchers/BoundsMatchersSpec.js index 28f38cc00..8163c3a26 100644 --- a/test/matchers/BoundsMatchersSpec.js +++ b/test/matchers/BoundsMatchersSpec.js @@ -1,6 +1,6 @@ import { create -} from 'lib/model'; +} from 'lib/model/index.js'; describe('matchers/BoundsMatchers', function() { diff --git a/test/matchers/ConnectionMatchers.js b/test/matchers/ConnectionMatchers.js index b2f24f114..88c15e801 100644 --- a/test/matchers/ConnectionMatchers.js +++ b/test/matchers/ConnectionMatchers.js @@ -1,7 +1,7 @@ import { pick } from 'min-dash'; /** - * @typedef {import('../../lib/util/Types').Point} Point + * @typedef {import('../../lib/util/Types.js').Point} Point */ var POSITION_ATTRS = [ 'x', 'y' ]; diff --git a/test/matchers/ConnectionMatchersSpec.js b/test/matchers/ConnectionMatchersSpec.js index cee2dbe3b..a599e54a1 100644 --- a/test/matchers/ConnectionMatchersSpec.js +++ b/test/matchers/ConnectionMatchersSpec.js @@ -1,6 +1,6 @@ import { create -} from 'lib/model'; +} from 'lib/model/index.js'; describe('matchers/ConnectionMatchers', function() { diff --git a/test/spec/command/CommandInterceptorSpec.js b/test/spec/command/CommandInterceptorSpec.js index 86ff711ce..a2defb14b 100644 --- a/test/spec/command/CommandInterceptorSpec.js +++ b/test/spec/command/CommandInterceptorSpec.js @@ -1,13 +1,13 @@ +import inherits from 'inherits-browser'; + import { bootstrapDiagram, inject -} from 'test/TestHelper'; - -import inherits from 'inherits-browser'; +} from 'test/TestHelper.js'; -import cmdModule from 'lib/command'; +import cmdModule from 'lib/command/index.js'; -import CommandInterceptor from 'lib/command/CommandInterceptor'; +import CommandInterceptor from 'lib/command/CommandInterceptor.js'; // example commands diff --git a/test/spec/command/CommandStackSpec.js b/test/spec/command/CommandStackSpec.js index 3403781dd..9a2a458da 100755 --- a/test/spec/command/CommandStackSpec.js +++ b/test/spec/command/CommandStackSpec.js @@ -1,10 +1,10 @@ import { bootstrapDiagram, inject -} from 'test/TestHelper'; +} from 'test/TestHelper.js'; -import cmdModule from 'lib/command'; +import cmdModule from 'lib/command/index.js'; // example commands diff --git a/test/spec/connection-preview/ConnectionPreviewSpec.js b/test/spec/connection-preview/ConnectionPreviewSpec.js index 76b6b3b29..143d14a5e 100755 --- a/test/spec/connection-preview/ConnectionPreviewSpec.js +++ b/test/spec/connection-preview/ConnectionPreviewSpec.js @@ -1,22 +1,25 @@ +import { + query as domQuery +} from 'min-dom'; + +import { + isDefined +} from 'min-dash'; + import { bootstrapDiagram, inject -} from 'test/TestHelper'; +} from 'test/TestHelper.js'; import TestContainer from 'mocha-test-container-support'; -import modelingModule from 'lib/features/modeling'; -import connectionPreviewModule from 'lib/features/connection-preview'; - -import BaseLayouter from 'lib/layout/BaseLayouter'; -import CroppingConnectionDocking from 'lib/layout/CroppingConnectionDocking'; +import modelingModule from 'lib/features/modeling/index.js'; +import connectionPreviewModule from 'lib/features/connection-preview/index.js'; -import { - query as domQuery -} from 'min-dom'; -import { isDefined } from 'min-dash'; +import BaseLayouter from 'lib/layout/BaseLayouter.js'; +import CroppingConnectionDocking from 'lib/layout/CroppingConnectionDocking.js'; -import { getMid } from '../../../lib/layout/LayoutUtil'; +import { getMid } from '../../../lib/layout/LayoutUtil.js'; var testModules = [ modelingModule, diff --git a/test/spec/core/CanvasSpec.js b/test/spec/core/CanvasSpec.js index 27cc3f5f9..7b35685df 100644 --- a/test/spec/core/CanvasSpec.js +++ b/test/spec/core/CanvasSpec.js @@ -1,11 +1,3 @@ -import { - bootstrapDiagram, - getDiagramJS, - inject -} from 'test/TestHelper'; - -import TestContainer from 'mocha-test-container-support'; - import { merge } from 'min-dash'; import { @@ -17,7 +9,15 @@ import { classes as svgClasses } from 'tiny-svg'; -import { getChildren as getChildrenGfx } from 'lib/util/GraphicsUtil'; +import TestContainer from 'mocha-test-container-support'; + +import { + bootstrapDiagram, + getDiagramJS, + inject +} from 'test/TestHelper.js'; + +import { getChildren as getChildrenGfx } from 'lib/util/GraphicsUtil.js'; describe('Canvas', function() { diff --git a/test/spec/core/ElementRegistrySpec.js b/test/spec/core/ElementRegistrySpec.js index 18c6ab6e7..e6bf96d32 100755 --- a/test/spec/core/ElementRegistrySpec.js +++ b/test/spec/core/ElementRegistrySpec.js @@ -1,7 +1,7 @@ import { bootstrapDiagram, inject -} from 'test/TestHelper'; +} from 'test/TestHelper.js'; describe('ElementRegistry', function() { diff --git a/test/spec/core/EventBusSpec.js b/test/spec/core/EventBusSpec.js index f24e8726f..fe6d28e36 100755 --- a/test/spec/core/EventBusSpec.js +++ b/test/spec/core/EventBusSpec.js @@ -1,4 +1,4 @@ -import EventBus from 'lib/core/EventBus'; +import EventBus from 'lib/core/EventBus.js'; describe('core/EventBus', function() { diff --git a/test/spec/core/GraphicsFactorySpec.js b/test/spec/core/GraphicsFactorySpec.js index 7e39e931f..408e37892 100644 --- a/test/spec/core/GraphicsFactorySpec.js +++ b/test/spec/core/GraphicsFactorySpec.js @@ -1,12 +1,12 @@ -import { - bootstrapDiagram, - inject -} from 'test/TestHelper'; - import { classes as svgClasses } from 'tiny-svg'; +import { + bootstrapDiagram, + inject +} from 'test/TestHelper.js'; + describe('GraphicsFactory', function() { diff --git a/test/spec/draw/DefaultRendererSpec.js b/test/spec/draw/DefaultRendererSpec.js index cf489d048..96c532083 100644 --- a/test/spec/draw/DefaultRendererSpec.js +++ b/test/spec/draw/DefaultRendererSpec.js @@ -1,10 +1,11 @@ +import { create } from 'tiny-svg'; + import { bootstrapDiagram, inject -} from 'test/TestHelper'; -import { create } from 'tiny-svg'; +} from 'test/TestHelper.js'; -import drawModule from 'lib/draw'; +import drawModule from 'lib/draw/index.js'; describe('draw - DefaultRenderer', function() { diff --git a/test/spec/draw/StylesSpec.js b/test/spec/draw/StylesSpec.js index c0c62a521..1f4646877 100755 --- a/test/spec/draw/StylesSpec.js +++ b/test/spec/draw/StylesSpec.js @@ -1,4 +1,4 @@ -import Styles from 'lib/draw/Styles'; +import Styles from 'lib/draw/Styles.js'; describe('draw/Styles', function() { diff --git a/test/spec/environment/MockingSpec.js b/test/spec/environment/MockingSpec.js index 914e9ded2..9c27270f0 100755 --- a/test/spec/environment/MockingSpec.js +++ b/test/spec/environment/MockingSpec.js @@ -1,10 +1,9 @@ import { bootstrapDiagram, inject -} from 'test/TestHelper'; +} from 'test/TestHelper.js'; - -import EventBus from 'lib/core/EventBus'; +import EventBus from 'lib/core/EventBus.js'; describe('environment/Mocking', function() { diff --git a/test/spec/features/align-elements/AlignElementsSpec.js b/test/spec/features/align-elements/AlignElementsSpec.js index aca1bdaf4..187288063 100644 --- a/test/spec/features/align-elements/AlignElementsSpec.js +++ b/test/spec/features/align-elements/AlignElementsSpec.js @@ -1,13 +1,13 @@ +import { forEach, sortBy } from 'min-dash'; + import { bootstrapDiagram, inject -} from 'test/TestHelper'; - -import { forEach, sortBy } from 'min-dash'; +} from 'test/TestHelper.js'; -import alignElementsModule from 'lib/features/align-elements'; -import modelingModule from 'lib/features/modeling'; -import testRules from './rules'; +import alignElementsModule from 'lib/features/align-elements/index.js'; +import modelingModule from 'lib/features/modeling/index.js'; +import testRules from './rules/index.js'; describe('features/align-elements', function() { diff --git a/test/spec/features/align-elements/rules/TestRules.js b/test/spec/features/align-elements/rules/TestRules.js index f4cc5d1c0..20057a431 100755 --- a/test/spec/features/align-elements/rules/TestRules.js +++ b/test/spec/features/align-elements/rules/TestRules.js @@ -1,6 +1,6 @@ import inherits from 'inherits-browser'; -import RuleProvider from 'lib/features/rules/RuleProvider'; +import RuleProvider from 'lib/features/rules/RuleProvider.js'; export default function TestRules(eventBus) { RuleProvider.call(this, eventBus); diff --git a/test/spec/features/align-elements/rules/index.js b/test/spec/features/align-elements/rules/index.js index eb8ffc77c..4dc6c034e 100755 --- a/test/spec/features/align-elements/rules/index.js +++ b/test/spec/features/align-elements/rules/index.js @@ -1,4 +1,4 @@ -import TestRules from './TestRules'; +import TestRules from './TestRules.js'; export default { __init__: [ 'testRules' ], diff --git a/test/spec/features/attach-support/AttachSupportSpec.js b/test/spec/features/attach-support/AttachSupportSpec.js index ad56e858b..4a1d26bf9 100644 --- a/test/spec/features/attach-support/AttachSupportSpec.js +++ b/test/spec/features/attach-support/AttachSupportSpec.js @@ -1,25 +1,26 @@ -import { createCanvasEvent as canvasEvent } from '../../../util/MockEvents'; +import { pick } from 'min-dash'; + +import { query as domQuery } from 'min-dom'; + +import { classes as svgClasses } from 'tiny-svg'; + +import { createCanvasEvent as canvasEvent } from '../../../util/MockEvents.js'; import { bootstrapDiagram, inject -} from 'test/TestHelper'; +} from 'test/TestHelper.js'; -import { pick } from 'min-dash'; - -import attachSupportModule from 'lib/features/attach-support'; -import labelSupportModule from 'lib/features/label-support'; -import modelingModule from 'lib/features/modeling'; -import moveModule from 'lib/features/move'; -import replaceModule from 'lib/features/replace'; -import spaceToolModule from 'lib/features/space-tool'; -import rulesModule from './rules'; +import attachSupportModule from 'lib/features/attach-support/index.js'; +import labelSupportModule from 'lib/features/label-support/index.js'; +import modelingModule from 'lib/features/modeling/index.js'; +import moveModule from 'lib/features/move/index.js'; +import replaceModule from 'lib/features/replace/index.js'; +import spaceToolModule from 'lib/features/space-tool/index.js'; +import rulesModule from './rules/index.js'; -import { getNewAttachShapeDelta } from 'lib/util/AttachUtil'; +import { getNewAttachShapeDelta } from 'lib/util/AttachUtil.js'; -import { query as domQuery } from 'min-dom'; - -import { classes as svgClasses } from 'tiny-svg'; var ATTACH = { attach: true }; var NO_ATTACH = { attach: false }; diff --git a/test/spec/features/attach-support/rules/AttachRules.js b/test/spec/features/attach-support/rules/AttachRules.js index 2f52b3dfe..bbaa98e01 100644 --- a/test/spec/features/attach-support/rules/AttachRules.js +++ b/test/spec/features/attach-support/rules/AttachRules.js @@ -1,9 +1,10 @@ import inherits from 'inherits-browser'; -import RuleProvider from 'lib/features/rules/RuleProvider'; - import { forEach } from 'min-dash'; +import RuleProvider from 'lib/features/rules/RuleProvider.js'; + + export default function AttachRules(eventBus) { RuleProvider.call(this, eventBus); } diff --git a/test/spec/features/attach-support/rules/index.js b/test/spec/features/attach-support/rules/index.js index d8cf22904..23c6a923b 100755 --- a/test/spec/features/attach-support/rules/index.js +++ b/test/spec/features/attach-support/rules/index.js @@ -1,4 +1,4 @@ -import AttachRules from './AttachRules'; +import AttachRules from './AttachRules.js'; export default { __init__: [ 'attachRules' ], diff --git a/test/spec/features/auto-place/AutoPlaceSpec.js b/test/spec/features/auto-place/AutoPlaceSpec.js index 425d2542e..285918d71 100644 --- a/test/spec/features/auto-place/AutoPlaceSpec.js +++ b/test/spec/features/auto-place/AutoPlaceSpec.js @@ -1,25 +1,25 @@ +import { assign } from 'min-dash'; + import { bootstrapDiagram, inject -} from 'test/TestHelper'; +} from 'test/TestHelper.js'; -import autoPlaceModule from 'lib/features/auto-place'; -import coreModule from 'lib/core'; -import modelingModule from 'lib/features/modeling'; -import selectionModule from 'lib/features/selection'; +import autoPlaceModule from 'lib/features/auto-place/index.js'; +import coreModule from 'lib/core/index.js'; +import modelingModule from 'lib/features/modeling/index.js'; +import selectionModule from 'lib/features/selection/index.js'; -import { getMid } from 'lib/layout/LayoutUtil'; +import { getMid } from 'lib/layout/LayoutUtil.js'; import { findFreePosition, generateGetNextPosition, getConnectedAtPosition, getConnectedDistance -} from 'lib/features/auto-place/AutoPlaceUtil'; - -import { assign } from 'min-dash'; +} from 'lib/features/auto-place/AutoPlaceUtil.js'; -import { DEFAULT_DISTANCE } from 'lib/features/auto-place/AutoPlaceUtil'; +import { DEFAULT_DISTANCE } from 'lib/features/auto-place/AutoPlaceUtil.js'; describe('features/auto-place', function() { diff --git a/test/spec/features/auto-resize/AutoResizeSpec.js b/test/spec/features/auto-resize/AutoResizeSpec.js index 0525e8b8a..4d39d5ac7 100644 --- a/test/spec/features/auto-resize/AutoResizeSpec.js +++ b/test/spec/features/auto-resize/AutoResizeSpec.js @@ -1,21 +1,21 @@ +import inherits from 'inherits-browser'; + import { bootstrapDiagram, inject -} from 'test/TestHelper'; +} from 'test/TestHelper.js'; import { createCanvasEvent as canvasEvent -} from '../../../util/MockEvents'; +} from '../../../util/MockEvents.js'; -import modelingModule from 'lib/features/modeling'; -import autoResizeModule from 'lib/features/auto-resize'; -import createModule from 'lib/features/create'; -import replaceModule from 'lib/features/replace'; +import modelingModule from 'lib/features/modeling/index.js'; +import autoResizeModule from 'lib/features/auto-resize/index.js'; +import createModule from 'lib/features/create/index.js'; +import replaceModule from 'lib/features/replace/index.js'; -import AutoResizeProvider from 'lib/features/auto-resize/AutoResizeProvider'; -import AutoResize from 'lib/features/auto-resize/AutoResize'; - -import inherits from 'inherits-browser'; +import AutoResizeProvider from 'lib/features/auto-resize/AutoResizeProvider.js'; +import AutoResize from 'lib/features/auto-resize/AutoResize.js'; /** diff --git a/test/spec/features/auto-scroll/AutoScrollSpec.js b/test/spec/features/auto-scroll/AutoScrollSpec.js index e9f05cb54..5c3ec3680 100644 --- a/test/spec/features/auto-scroll/AutoScrollSpec.js +++ b/test/spec/features/auto-scroll/AutoScrollSpec.js @@ -1,12 +1,12 @@ -import { createCanvasEvent as canvasEvent } from '../../../util/MockEvents'; +import { createCanvasEvent as canvasEvent } from '../../../util/MockEvents.js'; import { bootstrapDiagram, inject -} from 'test/TestHelper'; +} from 'test/TestHelper.js'; -import dragModule from 'lib/features/dragging'; -import scrollModule from 'lib/features/auto-scroll'; +import dragModule from 'lib/features/dragging/index.js'; +import scrollModule from 'lib/features/auto-scroll/index.js'; describe('features/auto-scroll - AutoScroll', function() { diff --git a/test/spec/features/bendpoints/BendpointsMoveSpec.js b/test/spec/features/bendpoints/BendpointsMoveSpec.js index de9e2d14b..31bbc8848 100755 --- a/test/spec/features/bendpoints/BendpointsMoveSpec.js +++ b/test/spec/features/bendpoints/BendpointsMoveSpec.js @@ -1,29 +1,29 @@ +import { + query as domQuery, + queryAll as domQueryAll +} from 'min-dom'; + import { bootstrapDiagram, getDiagramJS, inject -} from 'test/TestHelper'; +} from 'test/TestHelper.js'; import { createCanvasEvent as canvasEvent -} from '../../../util/MockEvents'; +} from '../../../util/MockEvents.js'; -import bendpointsModule from 'lib/features/bendpoints'; -import rulesModule from './rules'; -import connectModule from 'lib/features/connect'; -import modelingModule from 'lib/features/modeling'; -import selectModule from 'lib/features/selection'; -import connectionPreviewModule from 'lib/features/connection-preview'; -import CroppingConnectionDocking from 'lib/layout/CroppingConnectionDocking'; +import bendpointsModule from 'lib/features/bendpoints/index.js'; +import rulesModule from './rules/index.js'; +import connectModule from 'lib/features/connect/index.js'; +import modelingModule from 'lib/features/modeling/index.js'; +import selectModule from 'lib/features/selection/index.js'; +import connectionPreviewModule from 'lib/features/connection-preview/index.js'; +import CroppingConnectionDocking from 'lib/layout/CroppingConnectionDocking.js'; -import { getMid } from 'lib/layout/LayoutUtil'; - -import { - query as domQuery, - queryAll as domQueryAll -} from 'min-dom'; +import { getMid } from 'lib/layout/LayoutUtil.js'; -import { isSnapped } from 'lib/features/snapping/SnapUtil'; +import { isSnapped } from 'lib/features/snapping/SnapUtil.js'; var testModules = [ bendpointsModule, diff --git a/test/spec/features/bendpoints/BendpointsSpec.js b/test/spec/features/bendpoints/BendpointsSpec.js index 24745a049..13a03a6fb 100755 --- a/test/spec/features/bendpoints/BendpointsSpec.js +++ b/test/spec/features/bendpoints/BendpointsSpec.js @@ -1,25 +1,25 @@ +import { + query as domQuery, + queryAll as domQueryAll +} from 'min-dom'; + import { bootstrapDiagram, inject -} from 'test/TestHelper'; +} from 'test/TestHelper.js'; -import modelingModule from 'lib/features/modeling'; -import bendpointsModule from 'lib/features/bendpoints'; -import rulesModule from './rules'; -import interactionModule from 'lib/features/interaction-events'; +import modelingModule from 'lib/features/modeling/index.js'; +import bendpointsModule from 'lib/features/bendpoints/index.js'; +import rulesModule from './rules/index.js'; +import interactionModule from 'lib/features/interaction-events/index.js'; import { createCanvasEvent as canvasEvent -} from '../../../util/MockEvents'; - -import { - query as domQuery, - queryAll as domQueryAll -} from 'min-dom'; +} from '../../../util/MockEvents.js'; import { getVisual -} from 'lib/util/GraphicsUtil'; +} from 'lib/util/GraphicsUtil.js'; describe('features/bendpoints', function() { diff --git a/test/spec/features/bendpoints/ConnectionSegmentMoveSpec.js b/test/spec/features/bendpoints/ConnectionSegmentMoveSpec.js index 77928cccd..1f2216206 100755 --- a/test/spec/features/bendpoints/ConnectionSegmentMoveSpec.js +++ b/test/spec/features/bendpoints/ConnectionSegmentMoveSpec.js @@ -2,20 +2,20 @@ import { bootstrapDiagram, getDiagramJS, inject -} from 'test/TestHelper'; +} from 'test/TestHelper.js'; -import { createCanvasEvent as canvasEvent } from '../../../util/MockEvents'; +import { createCanvasEvent as canvasEvent } from '../../../util/MockEvents.js'; -import bendpointsModule from 'lib/features/bendpoints'; -import modelingModule from 'lib/features/modeling'; -import selectModule from 'lib/features/selection'; +import bendpointsModule from 'lib/features/bendpoints/index.js'; +import modelingModule from 'lib/features/modeling/index.js'; +import selectModule from 'lib/features/selection/index.js'; -import CroppingConnectionDocking from 'lib/layout/CroppingConnectionDocking'; +import CroppingConnectionDocking from 'lib/layout/CroppingConnectionDocking.js'; -import { isSnapped } from 'lib/features/snapping/SnapUtil'; +import { isSnapped } from 'lib/features/snapping/SnapUtil.js'; -import { getMid } from 'lib/layout/LayoutUtil'; -import { getConnectionIntersection } from '../../../../lib/features/bendpoints/BendpointUtil'; +import { getMid } from 'lib/layout/LayoutUtil.js'; +import { getConnectionIntersection } from '../../../../lib/features/bendpoints/BendpointUtil.js'; var layoutModule = { connectionDocking: [ 'type', CroppingConnectionDocking ] diff --git a/test/spec/features/bendpoints/GeometricUtilSpec.js b/test/spec/features/bendpoints/GeometricUtilSpec.js index 9dc7c8efa..dfe74e230 100644 --- a/test/spec/features/bendpoints/GeometricUtilSpec.js +++ b/test/spec/features/bendpoints/GeometricUtilSpec.js @@ -4,7 +4,7 @@ import { getDistancePointPoint, perpendicularFoot, rotateVector -} from 'lib/features/bendpoints/GeometricUtil'; +} from 'lib/features/bendpoints/GeometricUtil.js'; describe('features/bendpoints - GeometricUtil', function() { diff --git a/test/spec/features/bendpoints/rules/BendpointRules.js b/test/spec/features/bendpoints/rules/BendpointRules.js index 5e2d100b1..5148c85aa 100755 --- a/test/spec/features/bendpoints/rules/BendpointRules.js +++ b/test/spec/features/bendpoints/rules/BendpointRules.js @@ -1,6 +1,6 @@ import inherits from 'inherits-browser'; -import RuleProvider from 'lib/features/rules/RuleProvider'; +import RuleProvider from 'lib/features/rules/RuleProvider.js'; export default function ConnectRules(eventBus) { RuleProvider.call(this, eventBus); diff --git a/test/spec/features/bendpoints/rules/index.js b/test/spec/features/bendpoints/rules/index.js index b5be26f72..fe4884f24 100755 --- a/test/spec/features/bendpoints/rules/index.js +++ b/test/spec/features/bendpoints/rules/index.js @@ -1,4 +1,4 @@ -import BendpointRules from './BendpointRules'; +import BendpointRules from './BendpointRules.js'; export default { __init__: [ 'bendpointRules' ], diff --git a/test/spec/features/change-support/ChangeSupportSpec.js b/test/spec/features/change-support/ChangeSupportSpec.js index dc3dc03ea..ec7edacc0 100644 --- a/test/spec/features/change-support/ChangeSupportSpec.js +++ b/test/spec/features/change-support/ChangeSupportSpec.js @@ -1,10 +1,10 @@ import { bootstrapDiagram, inject -} from 'test/TestHelper'; +} from 'test/TestHelper.js'; -import modelingModule from 'lib/features/modeling'; -import coreModule from 'lib/core'; +import modelingModule from 'lib/features/modeling/index.js'; +import coreModule from 'lib/core/index.js'; describe('features/change-support', function() { diff --git a/test/spec/features/clipboard/ClipboardSpec.js b/test/spec/features/clipboard/ClipboardSpec.js index ad7f2d91a..567949a6f 100644 --- a/test/spec/features/clipboard/ClipboardSpec.js +++ b/test/spec/features/clipboard/ClipboardSpec.js @@ -1,9 +1,9 @@ import { bootstrapDiagram, inject -} from 'test/TestHelper'; +} from 'test/TestHelper.js'; -import clipboardModule from 'lib/features/clipboard'; +import clipboardModule from 'lib/features/clipboard/index.js'; describe('features/clipboard', function() { diff --git a/test/spec/features/complex-preview/ComplexPreviewSpec.js b/test/spec/features/complex-preview/ComplexPreviewSpec.js index e509dff0c..dcd72e39e 100644 --- a/test/spec/features/complex-preview/ComplexPreviewSpec.js +++ b/test/spec/features/complex-preview/ComplexPreviewSpec.js @@ -1,16 +1,17 @@ +import { + query as domQuery, + queryAll as domQueryAll +} from 'min-dom'; + import { bootstrapDiagram, inject -} from 'test/TestHelper'; +} from 'test/TestHelper.js'; -import complexPreviewModule from 'lib/features/complex-preview'; -import modelingModule from 'lib/features/modeling'; -import rendererModule from '../preview-support/renderer'; +import complexPreviewModule from 'lib/features/complex-preview/index.js'; +import modelingModule from 'lib/features/modeling/index.js'; +import rendererModule from '../preview-support/renderer/index.js'; -import { - query as domQuery, - queryAll as domQueryAll -} from 'min-dom'; var testModules = [ complexPreviewModule, diff --git a/test/spec/features/connect/ConnectSpec.js b/test/spec/features/connect/ConnectSpec.js index a0600421e..db40b8186 100755 --- a/test/spec/features/connect/ConnectSpec.js +++ b/test/spec/features/connect/ConnectSpec.js @@ -1,20 +1,20 @@ -import { - bootstrapDiagram, - inject -} from 'test/TestHelper'; - import { classes as svgClasses } from 'tiny-svg'; -import { createCanvasEvent as canvasEvent } from '../../../util/MockEvents'; +import { + bootstrapDiagram, + inject +} from 'test/TestHelper.js'; + +import { createCanvasEvent as canvasEvent } from '../../../util/MockEvents.js'; -import modelingModule from 'lib/features/modeling'; -import rulesModule from './rules'; -import connectModule from 'lib/features/connect'; -import connectionPreviewModule from 'lib/features/connection-preview'; +import modelingModule from 'lib/features/modeling/index.js'; +import rulesModule from './rules/index.js'; +import connectModule from 'lib/features/connect/index.js'; +import connectionPreviewModule from 'lib/features/connection-preview/index.js'; -import { getMid } from 'lib/layout/LayoutUtil'; +import { getMid } from 'lib/layout/LayoutUtil.js'; var testModules = [ diff --git a/test/spec/features/connect/rules/ConnectRules.js b/test/spec/features/connect/rules/ConnectRules.js index d2232298f..9e806f4c5 100755 --- a/test/spec/features/connect/rules/ConnectRules.js +++ b/test/spec/features/connect/rules/ConnectRules.js @@ -1,10 +1,10 @@ import inherits from 'inherits-browser'; -import RuleProvider from 'lib/features/rules/RuleProvider'; +import RuleProvider from 'lib/features/rules/RuleProvider.js'; import { isFrameElement -} from 'lib/util/Elements'; +} from 'lib/util/Elements.js'; export default function ConnectRules(eventBus) { RuleProvider.call(this, eventBus); diff --git a/test/spec/features/connect/rules/index.js b/test/spec/features/connect/rules/index.js index 5bd9b7fff..aac02c1c6 100755 --- a/test/spec/features/connect/rules/index.js +++ b/test/spec/features/connect/rules/index.js @@ -1,4 +1,4 @@ -import ConnectRules from './ConnectRules'; +import ConnectRules from './ConnectRules.js'; export default { __init__: [ 'connectRules' ], diff --git a/test/spec/features/context-pad/ContextPadSpec.js b/test/spec/features/context-pad/ContextPadSpec.js index 06a402319..a5f535253 100755 --- a/test/spec/features/context-pad/ContextPadSpec.js +++ b/test/spec/features/context-pad/ContextPadSpec.js @@ -1,13 +1,3 @@ -import { - createEvent as globalEvent -} from '../../../util/MockEvents'; - -import { - bootstrapDiagram, - getDiagramJS, - inject -} from 'test/TestHelper'; - import { assign, isArray } from 'min-dash'; import { @@ -16,12 +6,22 @@ import { classes as domClasses } from 'min-dom'; -import { getBBox } from 'lib/util/Elements'; +import { + createEvent as globalEvent +} from '../../../util/MockEvents.js'; + +import { + bootstrapDiagram, + getDiagramJS, + inject +} from 'test/TestHelper.js'; + +import { getBBox } from 'lib/util/Elements.js'; -import contextPadModule from 'lib/features/context-pad'; -import selectionModule from 'lib/features/selection'; +import contextPadModule from 'lib/features/context-pad/index.js'; +import selectionModule from 'lib/features/selection/index.js'; -import ContextPadProvider from './ContextPadProvider'; +import ContextPadProvider from './ContextPadProvider.js'; var providerModule = { __init__: [ 'contextPadProvider' ], diff --git a/test/spec/features/copy-paste/CopyPasteSpec.js b/test/spec/features/copy-paste/CopyPasteSpec.js index 75b454bac..35802c711 100644 --- a/test/spec/features/copy-paste/CopyPasteSpec.js +++ b/test/spec/features/copy-paste/CopyPasteSpec.js @@ -1,9 +1,3 @@ -import { - bootstrapDiagram, - getDiagramJS, - inject -} from 'test/TestHelper'; - import { filter, isArray, @@ -12,19 +6,25 @@ import { some } from 'min-dash'; -import attachSupportModule from 'lib/features/attach-support'; -import copyPasteModule from 'lib/features/copy-paste'; -import modelingModule from 'lib/features/modeling'; -import rulesModule from './rules'; -import selectionModule from 'lib/features/selection'; +import { + bootstrapDiagram, + getDiagramJS, + inject +} from 'test/TestHelper.js'; + +import attachSupportModule from 'lib/features/attach-support/index.js'; +import copyPasteModule from 'lib/features/copy-paste/index.js'; +import modelingModule from 'lib/features/modeling/index.js'; +import rulesModule from './rules/index.js'; +import selectionModule from 'lib/features/selection/index.js'; import { isConnection, isLabel -} from '../../../../lib/util/ModelUtil'; +} from '../../../../lib/util/ModelUtil.js'; /** - * @typedef {import('../../../../lib/model/Types').Element} Element + * @typedef {import('../../../../lib/model/Types.js').Element} Element */ var HIGH_PRIORITY = 2000; diff --git a/test/spec/features/copy-paste/rules/CopyPasteRules.js b/test/spec/features/copy-paste/rules/CopyPasteRules.js index 2c8c85565..082791b19 100644 --- a/test/spec/features/copy-paste/rules/CopyPasteRules.js +++ b/test/spec/features/copy-paste/rules/CopyPasteRules.js @@ -1,6 +1,6 @@ import inherits from 'inherits-browser'; -import RuleProvider from 'lib/features/rules/RuleProvider'; +import RuleProvider from 'lib/features/rules/RuleProvider.js'; export default function CopyPasteRules(eventBus) { diff --git a/test/spec/features/copy-paste/rules/index.js b/test/spec/features/copy-paste/rules/index.js index f806ab4a2..dad7d0d1d 100644 --- a/test/spec/features/copy-paste/rules/index.js +++ b/test/spec/features/copy-paste/rules/index.js @@ -1,4 +1,4 @@ -import CopyPasteRules from './CopyPasteRules'; +import CopyPasteRules from './CopyPasteRules.js'; export default { __init__: [ 'copyPasteRules' ], diff --git a/test/spec/features/create/CreatePreviewSpec.js b/test/spec/features/create/CreatePreviewSpec.js index dee897952..15547480e 100644 --- a/test/spec/features/create/CreatePreviewSpec.js +++ b/test/spec/features/create/CreatePreviewSpec.js @@ -1,22 +1,23 @@ +import { queryAll as domQueryAll } from 'min-dom'; + +import { attr as svgAttr } from 'tiny-svg'; + import { bootstrapDiagram, inject -} from 'test/TestHelper'; +} from 'test/TestHelper.js'; import { createCanvasEvent as canvasEvent -} from '../../../util/MockEvents'; +} from '../../../util/MockEvents.js'; -import modelingModule from 'lib/features/modeling'; -import moveModule from 'lib/features/move'; -import dragModule from 'lib/features/dragging'; -import createModule from 'lib/features/create'; -import attachSupportModule from 'lib/features/attach-support'; -import rulesModule from './rules'; +import modelingModule from 'lib/features/modeling/index.js'; +import moveModule from 'lib/features/move/index.js'; +import dragModule from 'lib/features/dragging/index.js'; +import createModule from 'lib/features/create/index.js'; +import attachSupportModule from 'lib/features/attach-support/index.js'; +import rulesModule from './rules/index.js'; -import { queryAll as domQueryAll } from 'min-dom'; - -import { attr as svgAttr } from 'tiny-svg'; var testModules = [ createModule, diff --git a/test/spec/features/create/CreateSpec.js b/test/spec/features/create/CreateSpec.js index 8adba2f23..2a2d24ed2 100644 --- a/test/spec/features/create/CreateSpec.js +++ b/test/spec/features/create/CreateSpec.js @@ -1,25 +1,26 @@ +import { + classes as svgClasses +} from 'tiny-svg'; + import { bootstrapDiagram, inject -} from 'test/TestHelper'; +} from 'test/TestHelper.js'; import { createCanvasEvent as canvasEvent -} from '../../../util/MockEvents'; +} from '../../../util/MockEvents.js'; -import modelingModule from 'lib/features/modeling'; -import moveModule from 'lib/features/move'; -import dragModule from 'lib/features/dragging'; -import createModule from 'lib/features/create'; -import attachSupportModule from 'lib/features/attach-support'; -import connectionPreviewModule from 'lib/features/connection-preview'; -import rulesModule from './rules'; +import modelingModule from 'lib/features/modeling/index.js'; +import moveModule from 'lib/features/move/index.js'; +import dragModule from 'lib/features/dragging/index.js'; +import createModule from 'lib/features/create/index.js'; +import attachSupportModule from 'lib/features/attach-support/index.js'; +import connectionPreviewModule from 'lib/features/connection-preview/index.js'; +import rulesModule from './rules/index.js'; -import { - classes as svgClasses -} from 'tiny-svg'; +import { getMid } from 'lib/layout/LayoutUtil.js'; -import { getMid } from 'lib/layout/LayoutUtil'; var testModules = [ createModule, diff --git a/test/spec/features/create/rules/CreateRules.js b/test/spec/features/create/rules/CreateRules.js index 85c98de8c..26926705c 100755 --- a/test/spec/features/create/rules/CreateRules.js +++ b/test/spec/features/create/rules/CreateRules.js @@ -1,6 +1,6 @@ import inherits from 'inherits-browser'; -import RuleProvider from 'lib/features/rules/RuleProvider'; +import RuleProvider from 'lib/features/rules/RuleProvider.js'; export default function CreateRules(injector) { injector.invoke(RuleProvider, this); diff --git a/test/spec/features/create/rules/index.js b/test/spec/features/create/rules/index.js index b7c42f511..e796caf8a 100755 --- a/test/spec/features/create/rules/index.js +++ b/test/spec/features/create/rules/index.js @@ -1,4 +1,4 @@ -import CreateRules from './CreateRules'; +import CreateRules from './CreateRules.js'; export default { __init__: [ 'createRules' ], diff --git a/test/spec/features/distribute-elements/DistributeElementsSpec.js b/test/spec/features/distribute-elements/DistributeElementsSpec.js index 99166ad2c..fcf41f238 100644 --- a/test/spec/features/distribute-elements/DistributeElementsSpec.js +++ b/test/spec/features/distribute-elements/DistributeElementsSpec.js @@ -1,13 +1,13 @@ +import { forEach, sortBy } from 'min-dash'; + import { bootstrapDiagram, inject -} from 'test/TestHelper'; - -import { forEach, sortBy } from 'min-dash'; +} from 'test/TestHelper.js'; -import distributeElementsModule from 'lib/features/distribute-elements'; -import modelingModule from 'lib/features/modeling'; -import testRules from './rules'; +import distributeElementsModule from 'lib/features/distribute-elements/index.js'; +import modelingModule from 'lib/features/modeling/index.js'; +import testRules from './rules/index.js'; function expectRanges(rangeGroups, expectedRanges) { diff --git a/test/spec/features/distribute-elements/rules/TestRules.js b/test/spec/features/distribute-elements/rules/TestRules.js index e1b6cd668..85c652636 100755 --- a/test/spec/features/distribute-elements/rules/TestRules.js +++ b/test/spec/features/distribute-elements/rules/TestRules.js @@ -1,6 +1,6 @@ import inherits from 'inherits-browser'; -import RuleProvider from 'lib/features/rules/RuleProvider'; +import RuleProvider from 'lib/features/rules/RuleProvider.js'; export default function TestRules(eventBus) { RuleProvider.call(this, eventBus); diff --git a/test/spec/features/distribute-elements/rules/index.js b/test/spec/features/distribute-elements/rules/index.js index eb8ffc77c..4dc6c034e 100755 --- a/test/spec/features/distribute-elements/rules/index.js +++ b/test/spec/features/distribute-elements/rules/index.js @@ -1,4 +1,4 @@ -import TestRules from './TestRules'; +import TestRules from './TestRules.js'; export default { __init__: [ 'testRules' ], diff --git a/test/spec/features/dragging/DraggingSpec.js b/test/spec/features/dragging/DraggingSpec.js index b704b21b4..613b57774 100644 --- a/test/spec/features/dragging/DraggingSpec.js +++ b/test/spec/features/dragging/DraggingSpec.js @@ -1,20 +1,20 @@ +import { assign } from 'min-dash'; + +import { classes as svgClasses } from 'tiny-svg'; + import { bootstrapDiagram, inject -} from 'test/TestHelper'; +} from 'test/TestHelper.js'; -import { createCanvasEvent as canvasEvent } from '../../../util/MockEvents'; +import { createCanvasEvent as canvasEvent } from '../../../util/MockEvents.js'; -import { assign } from 'min-dash'; - -import dragModule from 'lib/features/dragging'; -import zoomScrollModule from 'lib/navigation/zoomscroll'; -import createModule from 'lib/features/create'; -import modelingModule from 'lib/features/modeling'; +import dragModule from 'lib/features/dragging/index.js'; +import zoomScrollModule from 'lib/navigation/zoomscroll/index.js'; +import createModule from 'lib/features/create/index.js'; +import modelingModule from 'lib/features/modeling/index.js'; -import { createKeyEvent } from 'test/util/KeyEvents'; - -import { classes as svgClasses } from 'tiny-svg'; +import { createKeyEvent } from 'test/util/KeyEvents.js'; describe('features/dragging - Dragging', function() { diff --git a/test/spec/features/editor-actions/EditorActionsSpec.js b/test/spec/features/editor-actions/EditorActionsSpec.js index ab51abbb3..f7721bfca 100644 --- a/test/spec/features/editor-actions/EditorActionsSpec.js +++ b/test/spec/features/editor-actions/EditorActionsSpec.js @@ -1,15 +1,15 @@ import { bootstrapDiagram, inject -} from 'test/TestHelper'; - -import editorActionsModule from 'lib/features/editor-actions'; -import copyPasteModule from 'lib/features/copy-paste'; -import selectionModule from 'lib/features/selection'; -import keyboardMoveModule from 'lib/navigation/keyboard-move'; -import keyboardMoveSelectionModule from 'lib/features/keyboard-move-selection'; -import modelingModule from 'lib/features/modeling'; -import customRulesModule from './rules'; +} from 'test/TestHelper.js'; + +import editorActionsModule from 'lib/features/editor-actions/index.js'; +import copyPasteModule from 'lib/features/copy-paste/index.js'; +import selectionModule from 'lib/features/selection/index.js'; +import keyboardMoveModule from 'lib/navigation/keyboard-move/index.js'; +import keyboardMoveSelectionModule from 'lib/features/keyboard-move-selection/index.js'; +import modelingModule from 'lib/features/modeling/index.js'; +import customRulesModule from './rules/index.js'; describe('features/editor-actions', function() { diff --git a/test/spec/features/editor-actions/rules/CustomRules.js b/test/spec/features/editor-actions/rules/CustomRules.js index b0563573c..254f6a098 100644 --- a/test/spec/features/editor-actions/rules/CustomRules.js +++ b/test/spec/features/editor-actions/rules/CustomRules.js @@ -1,6 +1,6 @@ import inherits from 'inherits-browser'; -import RuleProvider from 'lib/features/rules/RuleProvider'; +import RuleProvider from 'lib/features/rules/RuleProvider.js'; export default function CustomRules(eventBus) { RuleProvider.call(this, eventBus); diff --git a/test/spec/features/editor-actions/rules/index.js b/test/spec/features/editor-actions/rules/index.js index 69cbc264a..023c95328 100644 --- a/test/spec/features/editor-actions/rules/index.js +++ b/test/spec/features/editor-actions/rules/index.js @@ -1,4 +1,4 @@ -import CustomRules from './CustomRules'; +import CustomRules from './CustomRules.js'; export default { __init__: [ 'customRules' ], diff --git a/test/spec/features/global-connect/GlobalConnectSpec.js b/test/spec/features/global-connect/GlobalConnectSpec.js index 037299d4c..3e9b9f05f 100644 --- a/test/spec/features/global-connect/GlobalConnectSpec.js +++ b/test/spec/features/global-connect/GlobalConnectSpec.js @@ -1,13 +1,13 @@ import { bootstrapDiagram, inject -} from 'test/TestHelper'; +} from 'test/TestHelper.js'; -import { createCanvasEvent as canvasEvent } from '../../../util/MockEvents'; +import { createCanvasEvent as canvasEvent } from '../../../util/MockEvents.js'; -import modelingModule from 'lib/features/modeling'; -import globalConnectModule from 'lib/features/global-connect'; -import rulesModule from './rules'; +import modelingModule from 'lib/features/modeling/index.js'; +import globalConnectModule from 'lib/features/global-connect/index.js'; +import rulesModule from './rules/index.js'; describe('features/global-connect-tool', function() { diff --git a/test/spec/features/global-connect/rules/GlobalConnectRules.js b/test/spec/features/global-connect/rules/GlobalConnectRules.js index d5da89247..b392d6c86 100644 --- a/test/spec/features/global-connect/rules/GlobalConnectRules.js +++ b/test/spec/features/global-connect/rules/GlobalConnectRules.js @@ -1,6 +1,6 @@ import inherits from 'inherits-browser'; -import RuleProvider from 'lib/features/rules/RuleProvider'; +import RuleProvider from 'lib/features/rules/RuleProvider.js'; export default function GlobalConnectRules(eventBus) { RuleProvider.call(this, eventBus); diff --git a/test/spec/features/global-connect/rules/index.js b/test/spec/features/global-connect/rules/index.js index 24fbe7dcd..bf3bb7a91 100755 --- a/test/spec/features/global-connect/rules/index.js +++ b/test/spec/features/global-connect/rules/index.js @@ -1,4 +1,4 @@ -import GlobalConnectRules from './GlobalConnectRules'; +import GlobalConnectRules from './GlobalConnectRules.js'; export default { __init__: [ 'globalConnectRules' ], diff --git a/test/spec/features/grid-snapping/GridSnappingSpec.js b/test/spec/features/grid-snapping/GridSnappingSpec.js index 1e4400005..6b31bb0de 100644 --- a/test/spec/features/grid-snapping/GridSnappingSpec.js +++ b/test/spec/features/grid-snapping/GridSnappingSpec.js @@ -2,21 +2,21 @@ import { bootstrapDiagram, getDiagramJS, inject -} from 'test/TestHelper'; +} from 'test/TestHelper.js'; -import modelingModule from 'lib/features/modeling'; -import gridSnappingModule from 'lib/features/grid-snapping'; -import bendpointsModule from 'lib/features/bendpoints'; -import connectModule from 'lib/features/connect'; -import createModule from 'lib/features/create'; -import moveModule from 'lib/features/move'; -import resizeModule from 'lib/features/resize'; +import modelingModule from 'lib/features/modeling/index.js'; +import gridSnappingModule from 'lib/features/grid-snapping/index.js'; +import bendpointsModule from 'lib/features/bendpoints/index.js'; +import connectModule from 'lib/features/connect/index.js'; +import createModule from 'lib/features/create/index.js'; +import moveModule from 'lib/features/move/index.js'; +import resizeModule from 'lib/features/resize/index.js'; -import CroppingConnectionDocking from 'lib/layout/CroppingConnectionDocking'; +import CroppingConnectionDocking from 'lib/layout/CroppingConnectionDocking.js'; -import { asTRBL } from 'lib/layout/LayoutUtil'; +import { asTRBL } from 'lib/layout/LayoutUtil.js'; -import { SPACING } from 'lib/features/grid-snapping/GridUtil'; +import { SPACING } from 'lib/features/grid-snapping/GridUtil.js'; var layoutModule = { connectionDocking: [ 'type', CroppingConnectionDocking ] @@ -24,11 +24,11 @@ var layoutModule = { import { createCanvasEvent as canvasEvent -} from '../../../util/MockEvents'; +} from '../../../util/MockEvents.js'; import { isString } from 'min-dash'; -import { mid } from 'lib/features/snapping/SnapUtil'; +import { mid } from 'lib/features/snapping/SnapUtil.js'; var LOW_PRIORITY = 500; diff --git a/test/spec/features/grid-snapping/behavior/ResizeBehaviorSpec.js b/test/spec/features/grid-snapping/behavior/ResizeBehaviorSpec.js index 8e8807063..5d5a14233 100644 --- a/test/spec/features/grid-snapping/behavior/ResizeBehaviorSpec.js +++ b/test/spec/features/grid-snapping/behavior/ResizeBehaviorSpec.js @@ -1,17 +1,18 @@ +import inherits from 'inherits-browser'; + import { bootstrapDiagram, inject -} from 'test/TestHelper'; +} from 'test/TestHelper.js'; -import autoResizeModule from 'lib/features/auto-resize'; -import gridSnappingModule from 'lib/features/grid-snapping'; -import modelingModule from 'lib/features/modeling'; -import moveModule from 'lib/features/move'; +import autoResizeModule from 'lib/features/auto-resize/index.js'; +import gridSnappingModule from 'lib/features/grid-snapping/index.js'; +import modelingModule from 'lib/features/modeling/index.js'; +import moveModule from 'lib/features/move/index.js'; -import AutoResizeProvider from 'lib/features/auto-resize/AutoResizeProvider'; -import AutoResize from 'lib/features/auto-resize/AutoResize'; +import AutoResizeProvider from 'lib/features/auto-resize/AutoResizeProvider.js'; +import AutoResize from 'lib/features/auto-resize/AutoResize.js'; -import inherits from 'inherits-browser'; /** * Custom auto-resize provider. diff --git a/test/spec/features/grid-snapping/behavior/SpaceToolBehaviorSpec.js b/test/spec/features/grid-snapping/behavior/SpaceToolBehaviorSpec.js index 26e3a1bed..176ce70f0 100644 --- a/test/spec/features/grid-snapping/behavior/SpaceToolBehaviorSpec.js +++ b/test/spec/features/grid-snapping/behavior/SpaceToolBehaviorSpec.js @@ -1,16 +1,16 @@ import { bootstrapDiagram, inject -} from 'test/TestHelper'; +} from 'test/TestHelper.js'; -import gridSnappingModule from 'lib/features/grid-snapping'; -import modelingModule from 'lib/features/modeling'; -import moveModule from 'lib/features/move'; -import spaceToolModule from 'lib/features/space-tool'; +import gridSnappingModule from 'lib/features/grid-snapping/index.js'; +import modelingModule from 'lib/features/modeling/index.js'; +import moveModule from 'lib/features/move/index.js'; +import spaceToolModule from 'lib/features/space-tool/index.js'; import { createCanvasEvent as canvasEvent -} from '../../../../util/MockEvents'; +} from '../../../../util/MockEvents.js'; var spy = sinon.spy; diff --git a/test/spec/features/hand-tool/HandToolSpec.js b/test/spec/features/hand-tool/HandToolSpec.js index 33ec7ce73..53fa7b1cc 100644 --- a/test/spec/features/hand-tool/HandToolSpec.js +++ b/test/spec/features/hand-tool/HandToolSpec.js @@ -1,22 +1,23 @@ +import { + assign +} from 'min-dash'; + import { bootstrapDiagram, getDiagramJS, inject -} from 'test/TestHelper'; +} from 'test/TestHelper.js'; -import { createCanvasEvent as canvasEvent } from '../../../util/MockEvents'; +import { createCanvasEvent as canvasEvent } from '../../../util/MockEvents.js'; -import handToolModule from 'lib/features/hand-tool'; -import draggingModule from 'lib/features/dragging'; -import keyboardModule from 'lib/features/keyboard'; +import handToolModule from 'lib/features/hand-tool/index.js'; +import draggingModule from 'lib/features/dragging/index.js'; +import keyboardModule from 'lib/features/keyboard/index.js'; -import { createKeyEvent } from 'test/util/KeyEvents'; +import { createKeyEvent } from 'test/util/KeyEvents.js'; -import { - assign -} from 'min-dash'; +import { isMac } from 'lib/util/Platform.js'; -import { isMac } from 'lib/util/Platform'; var keyModifier = isMac() ? { metaKey: true } : { ctrlKey: true }; diff --git a/test/spec/features/hover-fix/HoverFixSpec.js b/test/spec/features/hover-fix/HoverFixSpec.js index 96c49cb2e..09d9ba8bb 100644 --- a/test/spec/features/hover-fix/HoverFixSpec.js +++ b/test/spec/features/hover-fix/HoverFixSpec.js @@ -1,14 +1,14 @@ +import { assign } from 'min-dash'; + import { bootstrapDiagram, inject -} from 'test/TestHelper'; - -import { assign } from 'min-dash'; +} from 'test/TestHelper.js'; -import { createCanvasEvent as canvasEvent } from '../../../util/MockEvents'; +import { createCanvasEvent as canvasEvent } from '../../../util/MockEvents.js'; -import dragModule from 'lib/features/dragging'; -import hoverFixModule from 'lib/features/hover-fix'; +import dragModule from 'lib/features/dragging/index.js'; +import hoverFixModule from 'lib/features/hover-fix/index.js'; describe('features/hover-fix', function() { diff --git a/test/spec/features/interaction-events/InteractionEventsSpec.js b/test/spec/features/interaction-events/InteractionEventsSpec.js index 4c1de7a5d..d4a2a55a3 100755 --- a/test/spec/features/interaction-events/InteractionEventsSpec.js +++ b/test/spec/features/interaction-events/InteractionEventsSpec.js @@ -1,10 +1,3 @@ -import { - bootstrapDiagram, - inject -} from 'test/TestHelper'; - -import interactionEventsModule from 'lib/features/interaction-events'; - import { queryAll as domQueryAll } from 'min-dom'; @@ -13,6 +6,13 @@ import { filter } from 'min-dash'; +import { + bootstrapDiagram, + inject +} from 'test/TestHelper.js'; + +import interactionEventsModule from 'lib/features/interaction-events/index.js'; + var bindings = { mouseover: 'element.hover', diff --git a/test/spec/features/keyboard-move-selection/KeyboardMoveSelectionSpec.js b/test/spec/features/keyboard-move-selection/KeyboardMoveSelectionSpec.js index 931f717a5..a3199af4b 100644 --- a/test/spec/features/keyboard-move-selection/KeyboardMoveSelectionSpec.js +++ b/test/spec/features/keyboard-move-selection/KeyboardMoveSelectionSpec.js @@ -1,17 +1,17 @@ +import { forEach } from 'min-dash'; + import { bootstrapDiagram, inject -} from 'test/TestHelper'; - -import { forEach } from 'min-dash'; +} from 'test/TestHelper.js'; -import keyboardMoveSelectionModule from 'lib/features/keyboard-move-selection'; -import modelingModule from 'lib/features/modeling'; -import rulesModule from './rules'; +import keyboardMoveSelectionModule from 'lib/features/keyboard-move-selection/index.js'; +import modelingModule from 'lib/features/modeling/index.js'; +import rulesModule from './rules/index.js'; -import { getMid } from 'lib/layout/LayoutUtil'; +import { getMid } from 'lib/layout/LayoutUtil.js'; -import { createKeyEvent } from 'test/util/KeyEvents'; +import { createKeyEvent } from 'test/util/KeyEvents.js'; var KEYS = { ArrowUp: 'up', diff --git a/test/spec/features/keyboard-move-selection/rules/KeyboardMoveRules.js b/test/spec/features/keyboard-move-selection/rules/KeyboardMoveRules.js index e1b02d9b0..4643d62eb 100644 --- a/test/spec/features/keyboard-move-selection/rules/KeyboardMoveRules.js +++ b/test/spec/features/keyboard-move-selection/rules/KeyboardMoveRules.js @@ -1,8 +1,9 @@ +import { find } from 'min-dash'; + import inherits from 'inherits-browser'; -import RuleProvider from 'lib/features/rules/RuleProvider'; +import RuleProvider from 'lib/features/rules/RuleProvider.js'; -import { find } from 'min-dash'; export default function CreateRules(injector) { injector.invoke(RuleProvider, this); diff --git a/test/spec/features/keyboard-move-selection/rules/index.js b/test/spec/features/keyboard-move-selection/rules/index.js index fed7bfabc..bb883fccd 100644 --- a/test/spec/features/keyboard-move-selection/rules/index.js +++ b/test/spec/features/keyboard-move-selection/rules/index.js @@ -1,4 +1,4 @@ -import KeyboardMoveRules from './KeyboardMoveRules'; +import KeyboardMoveRules from './KeyboardMoveRules.js'; export default { __init__: [ 'keyboardMoveRules' ], diff --git a/test/spec/features/keyboard/CopySpec.js b/test/spec/features/keyboard/CopySpec.js index ac2b4f713..02def3f9c 100644 --- a/test/spec/features/keyboard/CopySpec.js +++ b/test/spec/features/keyboard/CopySpec.js @@ -1,22 +1,22 @@ +import { + forEach +} from 'min-dash'; + import { bootstrapDiagram, inject -} from 'test/TestHelper'; +} from 'test/TestHelper.js'; -import { - forEach -} from 'min-dash'; +import copyPasteModule from 'lib/features/copy-paste/index.js'; +import modelingModule from 'lib/features/modeling/index.js'; +import keyboardModule from 'lib/features/keyboard/index.js'; +import editorActionsModule from 'lib/features/editor-actions/index.js'; -import copyPasteModule from 'lib/features/copy-paste'; -import modelingModule from 'lib/features/modeling'; -import keyboardModule from 'lib/features/keyboard'; -import editorActionsModule from 'lib/features/editor-actions'; +import { createKeyEvent } from 'test/util/KeyEvents.js'; -import { createKeyEvent } from 'test/util/KeyEvents'; var KEYS_COPY = [ 'c', 'C' ]; - describe('features/keyboard - copy', function() { var defaultDiagramConfig = { diff --git a/test/spec/features/keyboard/KeyboardSpec.js b/test/spec/features/keyboard/KeyboardSpec.js index 1368de6e4..ecd95dda3 100755 --- a/test/spec/features/keyboard/KeyboardSpec.js +++ b/test/spec/features/keyboard/KeyboardSpec.js @@ -1,5 +1,3 @@ -import TestContainer from 'mocha-test-container-support'; - import { assign } from 'min-dash'; @@ -8,15 +6,17 @@ import { domify } from 'min-dom'; -import modelingModule from 'lib/features/modeling'; -import keyboardModule from 'lib/features/keyboard'; +import TestContainer from 'mocha-test-container-support'; + +import modelingModule from 'lib/features/modeling/index.js'; +import keyboardModule from 'lib/features/keyboard/index.js'; import { bootstrapDiagram, inject -} from 'test/TestHelper'; +} from 'test/TestHelper.js'; -import { createKeyEvent } from 'test/util/KeyEvents'; +import { createKeyEvent } from 'test/util/KeyEvents.js'; describe('features/keyboard', function() { diff --git a/test/spec/features/keyboard/PasteSpec.js b/test/spec/features/keyboard/PasteSpec.js index 5e98ff0be..6bb25a3be 100644 --- a/test/spec/features/keyboard/PasteSpec.js +++ b/test/spec/features/keyboard/PasteSpec.js @@ -1,18 +1,18 @@ -import { - bootstrapDiagram, - inject -} from 'test/TestHelper'; - import { forEach } from 'min-dash'; -import copyPasteModule from 'lib/features/copy-paste'; -import modelingModule from 'lib/features/modeling'; -import keyboardModule from 'lib/features/keyboard'; -import editorActionsModule from 'lib/features/editor-actions'; +import { + bootstrapDiagram, + inject +} from 'test/TestHelper.js'; + +import copyPasteModule from 'lib/features/copy-paste/index.js'; +import modelingModule from 'lib/features/modeling/index.js'; +import keyboardModule from 'lib/features/keyboard/index.js'; +import editorActionsModule from 'lib/features/editor-actions/index.js'; -import { createKeyEvent } from 'test/util/KeyEvents'; +import { createKeyEvent } from 'test/util/KeyEvents.js'; var KEYS_PASTE = [ 'v', 'V' ]; diff --git a/test/spec/features/keyboard/RedoSpec.js b/test/spec/features/keyboard/RedoSpec.js index e54da0d44..2d4841997 100644 --- a/test/spec/features/keyboard/RedoSpec.js +++ b/test/spec/features/keyboard/RedoSpec.js @@ -1,17 +1,17 @@ -import { - bootstrapDiagram, - inject -} from 'test/TestHelper'; - import { forEach } from 'min-dash'; -import modelingModule from 'lib/features/modeling'; -import editorActionsModule from 'lib/features/editor-actions'; -import keyboardModule from 'lib/features/keyboard'; +import { + bootstrapDiagram, + inject +} from 'test/TestHelper.js'; + +import modelingModule from 'lib/features/modeling/index.js'; +import editorActionsModule from 'lib/features/editor-actions/index.js'; +import keyboardModule from 'lib/features/keyboard/index.js'; -import { createKeyEvent } from 'test/util/KeyEvents'; +import { createKeyEvent } from 'test/util/KeyEvents.js'; var KEYS_REDO = [ 'y', 'Y' ]; var KEYS_UNDO = [ 'z', 'Z' ]; diff --git a/test/spec/features/keyboard/RemoveSelectionSpec.js b/test/spec/features/keyboard/RemoveSelectionSpec.js index f144755f7..0bffab4af 100644 --- a/test/spec/features/keyboard/RemoveSelectionSpec.js +++ b/test/spec/features/keyboard/RemoveSelectionSpec.js @@ -1,17 +1,18 @@ +import { + forEach +} from 'min-dash'; + import { bootstrapDiagram, inject -} from 'test/TestHelper'; +} from 'test/TestHelper.js'; -import { - forEach -} from 'min-dash'; +import modelingModule from 'lib/features/modeling/index.js'; +import editorActionsModule from 'lib/features/editor-actions/index.js'; +import keyboardModule from 'lib/features/keyboard/index.js'; -import modelingModule from 'lib/features/modeling'; -import editorActionsModule from 'lib/features/editor-actions'; -import keyboardModule from 'lib/features/keyboard'; +import { createKeyEvent } from 'test/util/KeyEvents.js'; -import { createKeyEvent } from 'test/util/KeyEvents'; var KEYS = [ 'Backspace', @@ -19,7 +20,6 @@ var KEYS = [ 'Del' ]; - describe('features/keyboard - remove selection', function() { var defaultDiagramConfig = { diff --git a/test/spec/features/keyboard/UndoSpec.js b/test/spec/features/keyboard/UndoSpec.js index b21de0690..04b78b61b 100644 --- a/test/spec/features/keyboard/UndoSpec.js +++ b/test/spec/features/keyboard/UndoSpec.js @@ -1,21 +1,21 @@ +import { + forEach +} from 'min-dash'; + import { bootstrapDiagram, inject -} from 'test/TestHelper'; +} from 'test/TestHelper.js'; -import { - forEach -} from 'min-dash'; +import modelingModule from 'lib/features/modeling/index.js'; +import editorActionsModule from 'lib/features/editor-actions/index.js'; +import keyboardModule from 'lib/features/keyboard/index.js'; -import modelingModule from 'lib/features/modeling'; -import editorActionsModule from 'lib/features/editor-actions'; -import keyboardModule from 'lib/features/keyboard'; +import { createKeyEvent } from 'test/util/KeyEvents.js'; -import { createKeyEvent } from 'test/util/KeyEvents'; var KEYS_UNDO = [ 'z', 'Z' ]; - describe('features/keyboard - undo', function() { var defaultDiagramConfig = { diff --git a/test/spec/features/keyboard/ZoomSpec.js b/test/spec/features/keyboard/ZoomSpec.js index 30951f57b..241f04ca8 100644 --- a/test/spec/features/keyboard/ZoomSpec.js +++ b/test/spec/features/keyboard/ZoomSpec.js @@ -1,17 +1,18 @@ +import { + forEach +} from 'min-dash'; + import { bootstrapDiagram, inject -} from 'test/TestHelper'; +} from 'test/TestHelper.js'; -import { - forEach -} from 'min-dash'; +import editorActionsModule from 'lib/features/editor-actions/index.js'; +import zoomScrollModule from 'lib/navigation/zoomscroll/index.js'; +import keyboardModule from 'lib/features/keyboard/index.js'; -import editorActionsModule from 'lib/features/editor-actions'; -import zoomScrollModule from 'lib/navigation/zoomscroll'; -import keyboardModule from 'lib/features/keyboard'; +import { createKeyEvent } from 'test/util/KeyEvents.js'; -import { createKeyEvent } from 'test/util/KeyEvents'; var KEYS = { ZOOM_IN: [ '+', 'Add', '=' ], diff --git a/test/spec/features/label-support/LabelSupportSpec.js b/test/spec/features/label-support/LabelSupportSpec.js index dfed5ccef..5592cb962 100644 --- a/test/spec/features/label-support/LabelSupportSpec.js +++ b/test/spec/features/label-support/LabelSupportSpec.js @@ -1,21 +1,21 @@ +import { + classes as svgClasses +} from 'tiny-svg'; + import { bootstrapDiagram, inject -} from 'test/TestHelper'; +} from 'test/TestHelper.js'; import { createCanvasEvent as canvasEvent -} from '../../../util/MockEvents'; +} from '../../../util/MockEvents.js'; -import labelSupportModule from 'lib/features/label-support'; -import moveModule from 'lib/features/move'; -import modelingModule from 'lib/features/modeling'; -import rulesModule from './rules'; -import spaceToolModule from 'lib/features/space-tool'; - -import { - classes as svgClasses -} from 'tiny-svg'; +import labelSupportModule from 'lib/features/label-support/index.js'; +import moveModule from 'lib/features/move/index.js'; +import modelingModule from 'lib/features/modeling/index.js'; +import rulesModule from './rules/index.js'; +import spaceToolModule from 'lib/features/space-tool/index.js'; describe('features/label-support', function() { diff --git a/test/spec/features/label-support/rules/LabelSupportRules.js b/test/spec/features/label-support/rules/LabelSupportRules.js index 9ba54fca5..8ba63bbaf 100755 --- a/test/spec/features/label-support/rules/LabelSupportRules.js +++ b/test/spec/features/label-support/rules/LabelSupportRules.js @@ -1,6 +1,7 @@ import inherits from 'inherits-browser'; -import RuleProvider from 'lib/features/rules/RuleProvider'; +import RuleProvider from 'lib/features/rules/RuleProvider.js'; + export default function LabelSupportRules(eventBus) { RuleProvider.call(this, eventBus); diff --git a/test/spec/features/label-support/rules/index.js b/test/spec/features/label-support/rules/index.js index 1ebbebc06..7d3b2b949 100755 --- a/test/spec/features/label-support/rules/index.js +++ b/test/spec/features/label-support/rules/index.js @@ -1,4 +1,4 @@ -import LabelSupportRules from './LabelSupportRules'; +import LabelSupportRules from './LabelSupportRules.js'; export default { __init__: [ 'labelSupportRules' ], diff --git a/test/spec/features/lasso-tool/LassoToolSpec.js b/test/spec/features/lasso-tool/LassoToolSpec.js index 184991d4e..03f918bd2 100755 --- a/test/spec/features/lasso-tool/LassoToolSpec.js +++ b/test/spec/features/lasso-tool/LassoToolSpec.js @@ -1,20 +1,20 @@ +import { + assign +} from 'min-dash'; + import { bootstrapDiagram, getDiagramJS, inject -} from 'test/TestHelper'; +} from 'test/TestHelper.js'; import { createCanvasEvent as canvasEvent -} from '../../../util/MockEvents'; - -import { - assign -} from 'min-dash'; +} from '../../../util/MockEvents.js'; -import modelingModule from 'lib/features/modeling'; -import lassoToolModule from 'lib/features/lasso-tool'; -import draggingModule from 'lib/features/dragging'; +import modelingModule from 'lib/features/modeling/index.js'; +import lassoToolModule from 'lib/features/lasso-tool/index.js'; +import draggingModule from 'lib/features/dragging/index.js'; describe('features/lasso-tool', function() { diff --git a/test/spec/features/modeling/AppendShapeSpec.js b/test/spec/features/modeling/AppendShapeSpec.js index cc8550a20..531c0d472 100644 --- a/test/spec/features/modeling/AppendShapeSpec.js +++ b/test/spec/features/modeling/AppendShapeSpec.js @@ -1,17 +1,16 @@ -import { - bootstrapDiagram, - inject -} from 'test/TestHelper'; - import { find } from 'min-dash'; -import modelingModule from 'lib/features/modeling'; +import { + bootstrapDiagram, + inject +} from 'test/TestHelper.js'; +import modelingModule from 'lib/features/modeling/index.js'; -describe('features/modeling - append shape', function() { +describe('features/modeling - append shape', function() { beforeEach(bootstrapDiagram({ modules: [ modelingModule ] })); diff --git a/test/spec/features/modeling/CreateConnectionSpec.js b/test/spec/features/modeling/CreateConnectionSpec.js index f8fc4cb75..9d04b3a67 100644 --- a/test/spec/features/modeling/CreateConnectionSpec.js +++ b/test/spec/features/modeling/CreateConnectionSpec.js @@ -1,9 +1,9 @@ import { bootstrapDiagram, inject -} from 'test/TestHelper'; +} from 'test/TestHelper.js'; -import modelingModule from 'lib/features/modeling'; +import modelingModule from 'lib/features/modeling/index.js'; describe('features/modeling - create connection', function() { diff --git a/test/spec/features/modeling/CreateElementsSpec.js b/test/spec/features/modeling/CreateElementsSpec.js index ae91c567f..f4cf6e756 100644 --- a/test/spec/features/modeling/CreateElementsSpec.js +++ b/test/spec/features/modeling/CreateElementsSpec.js @@ -1,16 +1,16 @@ +import { forEach } from 'min-dash'; + import { bootstrapDiagram, inject -} from 'test/TestHelper'; +} from 'test/TestHelper.js'; -import autoResizeModule from 'lib/features/auto-resize'; -import modelingModule from 'lib/features/modeling'; +import autoResizeModule from 'lib/features/auto-resize/index.js'; +import modelingModule from 'lib/features/modeling/index.js'; -import { getBBox } from 'lib/util/Elements'; +import { getBBox } from 'lib/util/Elements.js'; -import { getMid } from '../../../../lib/layout/LayoutUtil'; - -import { forEach } from 'min-dash'; +import { getMid } from '../../../../lib/layout/LayoutUtil.js'; describe('features/modeling - create elements', function() { diff --git a/test/spec/features/modeling/CreateLabelSpec.js b/test/spec/features/modeling/CreateLabelSpec.js index 9faad59ed..5cb33f6b1 100755 --- a/test/spec/features/modeling/CreateLabelSpec.js +++ b/test/spec/features/modeling/CreateLabelSpec.js @@ -1,9 +1,9 @@ import { bootstrapDiagram, inject -} from 'test/TestHelper'; +} from 'test/TestHelper.js'; -import modelingModule from 'lib/features/modeling'; +import modelingModule from 'lib/features/modeling/index.js'; describe('features/modeling - create label', function() { diff --git a/test/spec/features/modeling/CreateShapeSpec.js b/test/spec/features/modeling/CreateShapeSpec.js index f0b1c52c1..3d3a55f09 100644 --- a/test/spec/features/modeling/CreateShapeSpec.js +++ b/test/spec/features/modeling/CreateShapeSpec.js @@ -1,9 +1,9 @@ import { bootstrapDiagram, inject -} from 'test/TestHelper'; +} from 'test/TestHelper.js'; -import modelingModule from 'lib/features/modeling'; +import modelingModule from 'lib/features/modeling/index.js'; describe('features/modeling - create shape', function() { diff --git a/test/spec/features/modeling/DeleteConnectionSpec.js b/test/spec/features/modeling/DeleteConnectionSpec.js index 81f10644f..d8c507835 100755 --- a/test/spec/features/modeling/DeleteConnectionSpec.js +++ b/test/spec/features/modeling/DeleteConnectionSpec.js @@ -1,9 +1,9 @@ import { bootstrapDiagram, inject -} from 'test/TestHelper'; +} from 'test/TestHelper.js'; -import modelingModule from 'lib/features/modeling'; +import modelingModule from 'lib/features/modeling/index.js'; describe('features/modeling - remove connection', function() { diff --git a/test/spec/features/modeling/DeleteElementsSpec.js b/test/spec/features/modeling/DeleteElementsSpec.js index a1dbab479..88281b291 100755 --- a/test/spec/features/modeling/DeleteElementsSpec.js +++ b/test/spec/features/modeling/DeleteElementsSpec.js @@ -1,9 +1,9 @@ import { bootstrapDiagram, inject -} from 'test/TestHelper'; +} from 'test/TestHelper.js'; -import modelingModule from 'lib/features/modeling'; +import modelingModule from 'lib/features/modeling/index.js'; describe('features/modeling - #removeElements', function() { diff --git a/test/spec/features/modeling/DeleteShapeSpec.js b/test/spec/features/modeling/DeleteShapeSpec.js index 47fb37c8a..db530f568 100755 --- a/test/spec/features/modeling/DeleteShapeSpec.js +++ b/test/spec/features/modeling/DeleteShapeSpec.js @@ -1,11 +1,11 @@ import { bootstrapDiagram, inject -} from 'test/TestHelper'; +} from 'test/TestHelper.js'; -import modelingModule from 'lib/features/modeling'; -import contextPadModule from 'lib/features/context-pad'; -import selectionModule from 'lib/features/selection'; +import modelingModule from 'lib/features/modeling/index.js'; +import contextPadModule from 'lib/features/context-pad/index.js'; +import selectionModule from 'lib/features/selection/index.js'; describe('features/modeling - #removeShape', function() { diff --git a/test/spec/features/modeling/DropShapeSpec.js b/test/spec/features/modeling/DropShapeSpec.js index a8405c786..fc55bf382 100755 --- a/test/spec/features/modeling/DropShapeSpec.js +++ b/test/spec/features/modeling/DropShapeSpec.js @@ -1,9 +1,9 @@ import { bootstrapDiagram, inject -} from 'test/TestHelper'; +} from 'test/TestHelper.js'; -import modelingModule from 'lib/features/modeling'; +import modelingModule from 'lib/features/modeling/index.js'; describe('features/modeling - move shape - drop', function() { diff --git a/test/spec/features/modeling/LayoutConnectionSpec.js b/test/spec/features/modeling/LayoutConnectionSpec.js index 4666caab7..4166a9896 100755 --- a/test/spec/features/modeling/LayoutConnectionSpec.js +++ b/test/spec/features/modeling/LayoutConnectionSpec.js @@ -1,12 +1,12 @@ import { bootstrapDiagram, inject -} from 'test/TestHelper'; +} from 'test/TestHelper.js'; -import customModelingModule from './custom'; +import customModelingModule from './custom/index.js'; -var spy = sinon.spy; +var spy = sinon.spy; describe('features/modeling - layout connection', function() { diff --git a/test/spec/features/modeling/MoveConnectionSpec.js b/test/spec/features/modeling/MoveConnectionSpec.js index 121b8beed..5abae12d1 100755 --- a/test/spec/features/modeling/MoveConnectionSpec.js +++ b/test/spec/features/modeling/MoveConnectionSpec.js @@ -1,9 +1,9 @@ import { bootstrapDiagram, inject -} from 'test/TestHelper'; +} from 'test/TestHelper.js'; -import modelingModule from 'lib/features/modeling'; +import modelingModule from 'lib/features/modeling/index.js'; describe('features/modeling - move connection', function() { diff --git a/test/spec/features/modeling/MoveElementsSpec.js b/test/spec/features/modeling/MoveElementsSpec.js index 5011e16de..180bec8f9 100644 --- a/test/spec/features/modeling/MoveElementsSpec.js +++ b/test/spec/features/modeling/MoveElementsSpec.js @@ -1,19 +1,19 @@ +import { + pick +} from 'min-dash'; + import { bootstrapDiagram, inject -} from 'test/TestHelper'; +} from 'test/TestHelper.js'; -import { - pick -} from 'min-dash'; +import modelingModule from 'lib/features/modeling/index.js'; -import modelingModule from 'lib/features/modeling'; function containment(element) { return pick(element, [ 'x', 'y', 'parent' ]); } - describe('features/modeling - move elements', function() { diff --git a/test/spec/features/modeling/MoveShapeSpec.js b/test/spec/features/modeling/MoveShapeSpec.js index 6d6f04f57..2bef32867 100755 --- a/test/spec/features/modeling/MoveShapeSpec.js +++ b/test/spec/features/modeling/MoveShapeSpec.js @@ -1,9 +1,9 @@ import { bootstrapDiagram, inject -} from 'test/TestHelper'; +} from 'test/TestHelper.js'; -import modelingModule from 'lib/features/modeling'; +import modelingModule from 'lib/features/modeling/index.js'; describe('features/modeling - move shape', function() { diff --git a/test/spec/features/modeling/ReconnectConnectionSpec.js b/test/spec/features/modeling/ReconnectConnectionSpec.js index 125f008bc..b4fe58883 100644 --- a/test/spec/features/modeling/ReconnectConnectionSpec.js +++ b/test/spec/features/modeling/ReconnectConnectionSpec.js @@ -1,9 +1,9 @@ import { bootstrapDiagram, inject -} from 'test/TestHelper'; +} from 'test/TestHelper.js'; -import modelingModule from 'lib/features/modeling'; +import modelingModule from 'lib/features/modeling/index.js'; describe('features/modeling - reconnect connection', function() { diff --git a/test/spec/features/modeling/ReplaceShapeSpec.js b/test/spec/features/modeling/ReplaceShapeSpec.js index d9baad8e3..3f71eb90d 100644 --- a/test/spec/features/modeling/ReplaceShapeSpec.js +++ b/test/spec/features/modeling/ReplaceShapeSpec.js @@ -1,9 +1,9 @@ import { bootstrapDiagram, inject -} from 'test/TestHelper'; +} from 'test/TestHelper.js'; -import modelingModule from 'lib/features/modeling'; +import modelingModule from 'lib/features/modeling/index.js'; describe('features/modeling - replace shape', function() { diff --git a/test/spec/features/modeling/ResizeShapeSpec.js b/test/spec/features/modeling/ResizeShapeSpec.js index 68a37a237..0f5bbeef3 100644 --- a/test/spec/features/modeling/ResizeShapeSpec.js +++ b/test/spec/features/modeling/ResizeShapeSpec.js @@ -1,39 +1,39 @@ -import { - bootstrapDiagram, - inject -} from 'test/TestHelper'; - import { pick } from 'min-dash'; +import { + bootstrapDiagram, + inject +} from 'test/TestHelper.js'; + import { resizeBounds -} from 'lib/features/resize/ResizeUtil'; +} from 'lib/features/resize/ResizeUtil.js'; import { createCanvasEvent as canvasEvent -} from '../../../util/MockEvents'; +} from '../../../util/MockEvents.js'; + +import { getBBox } from 'lib/util/Elements.js'; -import { getBBox } from 'lib/util/Elements'; +import modelingModule from 'lib/features/modeling/index.js'; +import resizeModule from 'lib/features/resize/index.js'; +import attachModule from 'lib/features/attach-support/index.js'; -import modelingModule from 'lib/features/modeling'; -import resizeModule from 'lib/features/resize'; -import attachModule from 'lib/features/attach-support'; +import CroppingConnectionDocking from 'lib/layout/CroppingConnectionDocking.js'; + +import { getNewAttachPoint } from 'lib/util/AttachUtil.js'; -import CroppingConnectionDocking from 'lib/layout/CroppingConnectionDocking'; var layoutModule = { connectionDocking: [ 'type', CroppingConnectionDocking ] }; -import { getNewAttachPoint } from 'lib/util/AttachUtil'; - function bounds(b) { return pick(b, [ 'x', 'y', 'width', 'height' ]); } - describe('features/modeling - resize shape', function() { beforeEach(bootstrapDiagram({ diff --git a/test/spec/features/modeling/ToggleShapeCollapseSpec.js b/test/spec/features/modeling/ToggleShapeCollapseSpec.js index 09a65a512..f221308b3 100644 --- a/test/spec/features/modeling/ToggleShapeCollapseSpec.js +++ b/test/spec/features/modeling/ToggleShapeCollapseSpec.js @@ -1,9 +1,9 @@ import { bootstrapDiagram, inject -} from 'test/TestHelper'; +} from 'test/TestHelper.js'; -import modelingModule from 'lib/features/modeling'; +import modelingModule from 'lib/features/modeling/index.js'; describe('features/modeling - toggle collapsed', function() { diff --git a/test/spec/features/modeling/UpdateAttachmentSpec.js b/test/spec/features/modeling/UpdateAttachmentSpec.js index 8a87c0a77..5d38ca1b4 100644 --- a/test/spec/features/modeling/UpdateAttachmentSpec.js +++ b/test/spec/features/modeling/UpdateAttachmentSpec.js @@ -1,9 +1,9 @@ import { bootstrapDiagram, inject -} from 'test/TestHelper'; +} from 'test/TestHelper.js'; -import modelingModule from 'lib/features/modeling'; +import modelingModule from 'lib/features/modeling/index.js'; describe('features/modeling - attach shape', function() { diff --git a/test/spec/features/modeling/custom/CustomLayouter.js b/test/spec/features/modeling/custom/CustomLayouter.js index 6db90f472..d8fa7fcb5 100644 --- a/test/spec/features/modeling/custom/CustomLayouter.js +++ b/test/spec/features/modeling/custom/CustomLayouter.js @@ -1,7 +1,7 @@ -import { getMid } from 'lib/layout/LayoutUtil'; +import { getMid } from 'lib/layout/LayoutUtil.js'; /** - * @typedef {import('../../model').Connection} Connection + * @typedef {import('../../model/index.js').Connection} Connection */ /** diff --git a/test/spec/features/modeling/custom/index.js b/test/spec/features/modeling/custom/index.js index ded4e4b4a..912cb271b 100644 --- a/test/spec/features/modeling/custom/index.js +++ b/test/spec/features/modeling/custom/index.js @@ -1,10 +1,10 @@ -import CommandModule from 'lib/command'; -import ChangeSupportModule from 'lib/features/change-support'; -import SelectionModule from 'lib/features/selection'; -import RulesModule from 'lib/features/rules'; +import CommandModule from 'lib/command/index.js'; +import ChangeSupportModule from 'lib/features/change-support/index.js'; +import SelectionModule from 'lib/features/selection/index.js'; +import RulesModule from 'lib/features/rules/index.js'; -import Modeling from 'lib/features/modeling/Modeling'; -import CustomLayouter from './CustomLayouter'; +import Modeling from 'lib/features/modeling/Modeling.js'; +import CustomLayouter from './CustomLayouter.js'; export default { diff --git a/test/spec/features/mouse/MouseSpec.js b/test/spec/features/mouse/MouseSpec.js index 3df5d2282..1bc215d9b 100644 --- a/test/spec/features/mouse/MouseSpec.js +++ b/test/spec/features/mouse/MouseSpec.js @@ -1,11 +1,11 @@ import { bootstrapDiagram, inject -} from 'test/TestHelper'; +} from 'test/TestHelper.js'; -import mouseModule from 'lib/features/mouse'; +import mouseModule from 'lib/features/mouse/index.js'; -import { createMoveEvent } from 'lib/features/mouse/Mouse'; +import { createMoveEvent } from 'lib/features/mouse/Mouse.js'; describe('features/mouse', function() { diff --git a/test/spec/features/move/MovePreviewSpec.js b/test/spec/features/move/MovePreviewSpec.js index d924b0860..d26437948 100644 --- a/test/spec/features/move/MovePreviewSpec.js +++ b/test/spec/features/move/MovePreviewSpec.js @@ -1,18 +1,3 @@ -import { - bootstrapDiagram, - inject -} from 'test/TestHelper'; - -import { - createCanvasEvent as canvasEvent -} from '../../../util/MockEvents'; - -import modelingModule from 'lib/features/modeling'; -import moveModule from 'lib/features/move'; -import attachSupportModule from 'lib/features/attach-support'; -import rulesModule from './rules'; -import rendererModule from '../preview-support/renderer'; - import { query as domQuery, queryAll as domQueryAll @@ -22,6 +7,21 @@ import { classes as svgClasses } from 'tiny-svg'; +import { + bootstrapDiagram, + inject +} from 'test/TestHelper.js'; + +import { + createCanvasEvent as canvasEvent +} from '../../../util/MockEvents.js'; + +import modelingModule from 'lib/features/modeling/index.js'; +import moveModule from 'lib/features/move/index.js'; +import attachSupportModule from 'lib/features/attach-support/index.js'; +import rulesModule from './rules/index.js'; +import rendererModule from '../preview-support/renderer/index.js'; + describe('features/move - MovePreview', function() { diff --git a/test/spec/features/move/MoveSpec.js b/test/spec/features/move/MoveSpec.js index a32d94e72..9e0440236 100644 --- a/test/spec/features/move/MoveSpec.js +++ b/test/spec/features/move/MoveSpec.js @@ -1,20 +1,20 @@ +import { + assign, + pick +} from 'min-dash'; + import { bootstrapDiagram, getDiagramJS, inject -} from 'test/TestHelper'; +} from 'test/TestHelper.js'; import { createCanvasEvent as canvasEvent -} from '../../../util/MockEvents'; - -import { - assign, - pick -} from 'min-dash'; +} from '../../../util/MockEvents.js'; -import modelingModule from 'lib/features/modeling'; -import moveModule from 'lib/features/move'; +import modelingModule from 'lib/features/modeling/index.js'; +import moveModule from 'lib/features/move/index.js'; describe('features/move - Move', function() { diff --git a/test/spec/features/move/rules/MoveRules.js b/test/spec/features/move/rules/MoveRules.js index b55304a28..33ce5b532 100755 --- a/test/spec/features/move/rules/MoveRules.js +++ b/test/spec/features/move/rules/MoveRules.js @@ -1,10 +1,11 @@ import inherits from 'inherits-browser'; -import RuleProvider from 'lib/features/rules/RuleProvider'; +import RuleProvider from 'lib/features/rules/RuleProvider.js'; import { isFrameElement -} from 'lib/util/Elements'; +} from 'lib/util/Elements.js'; + export default function MoveRules(eventBus) { RuleProvider.call(this, eventBus); diff --git a/test/spec/features/move/rules/index.js b/test/spec/features/move/rules/index.js index 88f5814c1..62dc0e6a7 100755 --- a/test/spec/features/move/rules/index.js +++ b/test/spec/features/move/rules/index.js @@ -1,4 +1,4 @@ -import MoveRules from './MoveRules'; +import MoveRules from './MoveRules.js'; export default { __init__: [ 'moveRules' ], diff --git a/test/spec/features/ordering/OrderingProviderSpec.js b/test/spec/features/ordering/OrderingProviderSpec.js index 562e336ab..bccddcac7 100644 --- a/test/spec/features/ordering/OrderingProviderSpec.js +++ b/test/spec/features/ordering/OrderingProviderSpec.js @@ -1,11 +1,11 @@ import { bootstrapDiagram, inject -} from 'test/TestHelper'; +} from 'test/TestHelper.js'; -import modelingModule from 'lib/features/modeling'; -import moveModule from 'lib/features/move'; -import orderingProviderModule from './provider'; +import modelingModule from 'lib/features/modeling/index.js'; +import moveModule from 'lib/features/move/index.js'; +import orderingProviderModule from './provider/index.js'; describe('features/ordering', function() { diff --git a/test/spec/features/ordering/provider/TestOrderingProvider.js b/test/spec/features/ordering/provider/TestOrderingProvider.js index 663c7cc17..8272cb201 100644 --- a/test/spec/features/ordering/provider/TestOrderingProvider.js +++ b/test/spec/features/ordering/provider/TestOrderingProvider.js @@ -1,11 +1,11 @@ import inherits from 'inherits-browser'; -import OrderingProvider from 'lib/features/ordering/OrderingProvider'; - import { findIndex } from 'min-dash'; +import OrderingProvider from 'lib/features/ordering/OrderingProvider.js'; + /** * a simple ordering provider that makes sure: diff --git a/test/spec/features/ordering/provider/index.js b/test/spec/features/ordering/provider/index.js index f0a05bce2..abac790ca 100644 --- a/test/spec/features/ordering/provider/index.js +++ b/test/spec/features/ordering/provider/index.js @@ -1,4 +1,4 @@ -import TestOrderingProvider from './TestOrderingProvider'; +import TestOrderingProvider from './TestOrderingProvider.js'; export default { __init__: [ 'testOrderingProvider' ], diff --git a/test/spec/features/outline/OutlineSpec.js b/test/spec/features/outline/OutlineSpec.js index 8ec3300ed..e91e42a5b 100755 --- a/test/spec/features/outline/OutlineSpec.js +++ b/test/spec/features/outline/OutlineSpec.js @@ -1,10 +1,3 @@ -import { - bootstrapDiagram, - inject -} from 'test/TestHelper'; - -import selectionModule from 'lib/features/selection'; - import { query as domQuery } from 'min-dom'; @@ -15,6 +8,13 @@ import { attr as svgAttr } from 'tiny-svg'; +import { + bootstrapDiagram, + inject +} from 'test/TestHelper.js'; + +import selectionModule from 'lib/features/selection/index.js'; + describe('features/outline/Outline', function() { diff --git a/test/spec/features/overlays/OverlaysIntegrationSpec.js b/test/spec/features/overlays/OverlaysIntegrationSpec.js index 45dc63928..2be6a2246 100755 --- a/test/spec/features/overlays/OverlaysIntegrationSpec.js +++ b/test/spec/features/overlays/OverlaysIntegrationSpec.js @@ -1,12 +1,3 @@ -import { - bootstrapDiagram, - inject -} from 'test/TestHelper'; - -import { - createCanvasEvent as canvasEvent -} from '../../../util/MockEvents'; - import { classes as domClasses, domify, @@ -15,15 +6,24 @@ import { import $ from 'jquery'; -import overlayModule from 'lib/features/overlays'; -import selectionModule from 'lib/features/selection'; -import modelingModule from 'lib/features/modeling'; -import resizeModule from 'lib/features/resize'; -import moveModule from 'lib/features/move'; +import { + bootstrapDiagram, + inject +} from 'test/TestHelper.js'; + +import { + createCanvasEvent as canvasEvent +} from '../../../util/MockEvents.js'; + +import overlayModule from 'lib/features/overlays/index.js'; +import selectionModule from 'lib/features/selection/index.js'; +import modelingModule from 'lib/features/modeling/index.js'; +import resizeModule from 'lib/features/resize/index.js'; +import moveModule from 'lib/features/move/index.js'; import { resizeBounds -} from 'lib/features/resize/ResizeUtil'; +} from 'lib/features/resize/ResizeUtil.js'; describe('features/overlay - integration', function() { diff --git a/test/spec/features/overlays/OverlaysSpec.js b/test/spec/features/overlays/OverlaysSpec.js index 510e1f4ba..fed99c0b8 100644 --- a/test/spec/features/overlays/OverlaysSpec.js +++ b/test/spec/features/overlays/OverlaysSpec.js @@ -1,9 +1,3 @@ -import { - bootstrapDiagram, - getDiagramJS, - inject -} from 'test/TestHelper'; - import { forEach, assign @@ -14,7 +8,13 @@ import { assignStyle } from 'min-dom'; -import overlayModule from 'lib/features/overlays'; +import { + bootstrapDiagram, + getDiagramJS, + inject +} from 'test/TestHelper.js'; + +import overlayModule from 'lib/features/overlays/index.js'; describe('features/overlays', function() { diff --git a/test/spec/features/palette/PaletteSpec.js b/test/spec/features/palette/PaletteSpec.js index c989853b1..38c0139bc 100755 --- a/test/spec/features/palette/PaletteSpec.js +++ b/test/spec/features/palette/PaletteSpec.js @@ -1,15 +1,3 @@ -import { - bootstrapDiagram, - getDiagramJS, - inject -} from 'test/TestHelper'; - -import { - createEvent as globalEvent -} from '../../../util/MockEvents'; - -import paletteModule from 'lib/features/palette'; - import { query as domQuery, classes as domClasses @@ -19,6 +7,18 @@ import { assign } from 'min-dash'; +import { + bootstrapDiagram, + getDiagramJS, + inject +} from 'test/TestHelper.js'; + +import { + createEvent as globalEvent +} from '../../../util/MockEvents.js'; + +import paletteModule from 'lib/features/palette/index.js'; + describe('features/palette', function() { diff --git a/test/spec/features/popup-menu/PopupMenuComponentSpec.js b/test/spec/features/popup-menu/PopupMenuComponentSpec.js index 4a9cd0dde..694b4d2c5 100644 --- a/test/spec/features/popup-menu/PopupMenuComponentSpec.js +++ b/test/spec/features/popup-menu/PopupMenuComponentSpec.js @@ -1,13 +1,13 @@ -import PopupMenuComponent from 'lib/features/popup-menu/PopupMenuComponent'; +import PopupMenuComponent from 'lib/features/popup-menu/PopupMenuComponent.js'; import { html, render -} from 'lib/ui'; +} from 'lib/ui/index.js'; import { insertCSS -} from 'test/TestHelper'; +} from 'test/TestHelper.js'; import { domify, diff --git a/test/spec/features/popup-menu/PopupMenuItemSpec.js b/test/spec/features/popup-menu/PopupMenuItemSpec.js index 052197bcf..afef34202 100644 --- a/test/spec/features/popup-menu/PopupMenuItemSpec.js +++ b/test/spec/features/popup-menu/PopupMenuItemSpec.js @@ -1,13 +1,14 @@ -import PopupMenuItem from 'lib/features/popup-menu/PopupMenuItem'; +import { + query as domQuery +} from 'min-dom'; + +import PopupMenuItem from 'lib/features/popup-menu/PopupMenuItem.js'; import { html, render -} from 'lib/ui'; +} from 'lib/ui/index.js'; -import { - query as domQuery -} from 'min-dom'; describe('features/popup-menu - ', function() { diff --git a/test/spec/features/popup-menu/PopupMenuListSpec.js b/test/spec/features/popup-menu/PopupMenuListSpec.js index c20262680..610d47b8c 100644 --- a/test/spec/features/popup-menu/PopupMenuListSpec.js +++ b/test/spec/features/popup-menu/PopupMenuListSpec.js @@ -1,13 +1,13 @@ -import PopupMenuList from 'lib/features/popup-menu/PopupMenuList'; +import { + query as domQuery +} from 'min-dom'; + +import PopupMenuList from 'lib/features/popup-menu/PopupMenuList.js'; import { html, render -} from 'lib/ui'; - -import { - query as domQuery -} from 'min-dom'; +} from 'lib/ui/index.js'; describe('features/popup-menu - ', function() { diff --git a/test/spec/features/popup-menu/PopupMenuSpec.js b/test/spec/features/popup-menu/PopupMenuSpec.js index 1a5e66004..eb6294e11 100755 --- a/test/spec/features/popup-menu/PopupMenuSpec.js +++ b/test/spec/features/popup-menu/PopupMenuSpec.js @@ -1,13 +1,3 @@ -import { waitFor as originalWaitFor } from '@testing-library/preact'; - -import { - bootstrapDiagram, - getDiagramJS, - inject -} from 'test/TestHelper'; - -import testImage from './resources/a.png'; - import { assign, isFunction @@ -19,12 +9,23 @@ import { classes as domClasses } from 'min-dom'; -import { createEvent as globalEvent } from '../../../util/MockEvents'; +import { waitFor as originalWaitFor } from '@testing-library/preact'; + +import { + bootstrapDiagram, + getDiagramJS, + inject +} from 'test/TestHelper.js'; + +import testImage from './resources/a.png'; + +import { createEvent as globalEvent } from '../../../util/MockEvents.js'; + +import popupMenuModule from 'lib/features/popup-menu/index.js'; +import modelingModule from 'lib/features/modeling/index.js'; -import popupMenuModule from 'lib/features/popup-menu'; -import modelingModule from 'lib/features/modeling'; +import { html } from 'lib/ui/index.js'; -import { html } from 'lib/ui'; const waitFor = (callback) => originalWaitFor(callback, { timeout: 10000 }); diff --git a/test/spec/features/preview-support/renderer/MarkerRenderer.js b/test/spec/features/preview-support/renderer/MarkerRenderer.js index 95b6d3bf2..49b988308 100644 --- a/test/spec/features/preview-support/renderer/MarkerRenderer.js +++ b/test/spec/features/preview-support/renderer/MarkerRenderer.js @@ -10,14 +10,14 @@ import { query as domQuery } from 'min-dom'; -import DefaultRenderer from 'lib/draw/DefaultRenderer'; +import DefaultRenderer from 'lib/draw/DefaultRenderer.js'; import { createLine -} from 'lib//util/RenderUtil'; +} from 'lib/util/RenderUtil.js'; /** - * @typedef {import('../../model').Connection} Connection + * @typedef {import('../../model/index.js').Connection} Connection */ var HIGH_PRIORITY = 3000; diff --git a/test/spec/features/preview-support/renderer/index.js b/test/spec/features/preview-support/renderer/index.js index 80b3cb1d8..ef6dc5f50 100644 --- a/test/spec/features/preview-support/renderer/index.js +++ b/test/spec/features/preview-support/renderer/index.js @@ -1,4 +1,4 @@ -import MarkerRenderer from './MarkerRenderer'; +import MarkerRenderer from './MarkerRenderer.js'; export default { __init__: [ 'defaultRenderer' ], diff --git a/test/spec/features/replace/ReplaceSelectionBehaviorSpec.js b/test/spec/features/replace/ReplaceSelectionBehaviorSpec.js index 8aef63ae8..8793a13c2 100644 --- a/test/spec/features/replace/ReplaceSelectionBehaviorSpec.js +++ b/test/spec/features/replace/ReplaceSelectionBehaviorSpec.js @@ -1,10 +1,10 @@ import { bootstrapDiagram, inject -} from 'test/TestHelper'; +} from 'test/TestHelper.js'; -import modelingModule from 'lib/features/modeling'; -import replaceModule from 'lib/features/replace'; +import modelingModule from 'lib/features/modeling/index.js'; +import replaceModule from 'lib/features/replace/index.js'; describe('features/replace - ReplaceSelectionBehavior', function() { diff --git a/test/spec/features/replace/ReplaceSpec.js b/test/spec/features/replace/ReplaceSpec.js index e2e98e2bc..add87a80d 100755 --- a/test/spec/features/replace/ReplaceSpec.js +++ b/test/spec/features/replace/ReplaceSpec.js @@ -1,10 +1,7 @@ import { bootstrapDiagram, inject -} from 'test/TestHelper'; - -import modelingModule from 'lib/features/modeling'; -import replaceModule from 'lib/features/replace'; +} from 'test/TestHelper.js'; import { query as domQuery @@ -14,6 +11,9 @@ import { pick } from 'min-dash'; +import modelingModule from 'lib/features/modeling/index.js'; +import replaceModule from 'lib/features/replace/index.js'; + describe('features/replace - Replace', function() { diff --git a/test/spec/features/resize/ResizeSpec.js b/test/spec/features/resize/ResizeSpec.js index 85e6e0779..12a8af483 100644 --- a/test/spec/features/resize/ResizeSpec.js +++ b/test/spec/features/resize/ResizeSpec.js @@ -1,33 +1,33 @@ +import { pick } from 'min-dash'; + +import { + query as domQuery, + queryAll as domQueryAll +} from 'min-dom'; + +import { classes as svgClasses } from 'tiny-svg'; + import { bootstrapDiagram, inject -} from 'test/TestHelper'; +} from 'test/TestHelper.js'; import { createCanvasEvent as canvasEvent -} from '../../../util/MockEvents'; +} from '../../../util/MockEvents.js'; -import { pick } from 'min-dash'; +import resizeModule from 'lib/features/resize/index.js'; +import modelingModule from 'lib/features/modeling/index.js'; +import rulesModule from './rules/index.js'; +import selectModule from 'lib/features/selection/index.js'; -import resizeModule from 'lib/features/resize'; -import modelingModule from 'lib/features/modeling'; -import rulesModule from './rules'; -import selectModule from 'lib/features/selection'; +import { getReferencePoint } from 'lib/features/resize/Resize.js'; -import { getReferencePoint } from 'lib/features/resize/Resize'; - -import { - query as domQuery, - queryAll as domQueryAll -} from 'min-dom'; - -import { classes as svgClasses } from 'tiny-svg'; function bounds(b) { return pick(b, [ 'x', 'y', 'width', 'height' ]); } - describe('features/resize - Resize', function() { beforeEach(bootstrapDiagram({ diff --git a/test/spec/features/resize/ResizeUtilSpec.js b/test/spec/features/resize/ResizeUtilSpec.js index 9b1fe554f..d355aca9d 100755 --- a/test/spec/features/resize/ResizeUtilSpec.js +++ b/test/spec/features/resize/ResizeUtilSpec.js @@ -4,12 +4,11 @@ import { getMinResizeBounds, resizeBounds, reattachPoint -} from 'lib/features/resize/ResizeUtil'; +} from 'lib/features/resize/ResizeUtil.js'; describe('resize/ResizeUtil', function() { - describe('resizeBounds', function() { // given diff --git a/test/spec/features/resize/rules/ResizeRules.js b/test/spec/features/resize/rules/ResizeRules.js index d469a2151..7ee82a29a 100755 --- a/test/spec/features/resize/rules/ResizeRules.js +++ b/test/spec/features/resize/rules/ResizeRules.js @@ -1,6 +1,7 @@ import inherits from 'inherits-browser'; -import RuleProvider from 'lib/features/rules/RuleProvider'; +import RuleProvider from 'lib/features/rules/RuleProvider.js'; + export default function ResizeRules(eventBus) { RuleProvider.call(this, eventBus); diff --git a/test/spec/features/resize/rules/index.js b/test/spec/features/resize/rules/index.js index 53367a356..bf4c77140 100755 --- a/test/spec/features/resize/rules/index.js +++ b/test/spec/features/resize/rules/index.js @@ -1,4 +1,4 @@ -import ResizeRules from './ResizeRules'; +import ResizeRules from './ResizeRules.js'; export default { __init__: [ 'resizeRules' ], diff --git a/test/spec/features/root-elements/RootElementsBehaviorSpec.js b/test/spec/features/root-elements/RootElementsBehaviorSpec.js index 97293b82c..baaf46ab1 100644 --- a/test/spec/features/root-elements/RootElementsBehaviorSpec.js +++ b/test/spec/features/root-elements/RootElementsBehaviorSpec.js @@ -1,12 +1,12 @@ import { bootstrapDiagram, inject -} from 'test/TestHelper'; +} from 'test/TestHelper.js'; -import coreModule from 'lib/core'; -import commandModule from 'lib/command'; -import modelingModule from 'lib/features/modeling'; -import rootElementsModule from 'lib/features/root-elements'; +import coreModule from 'lib/core/index.js'; +import commandModule from 'lib/command/index.js'; +import modelingModule from 'lib/features/modeling/index.js'; +import rootElementsModule from 'lib/features/root-elements/index.js'; describe('features/planes/RootElementsBehavior', function() { diff --git a/test/spec/features/rules/RuleProviderSpec.js b/test/spec/features/rules/RuleProviderSpec.js index 3ed3c6e0f..a3f00ebc7 100755 --- a/test/spec/features/rules/RuleProviderSpec.js +++ b/test/spec/features/rules/RuleProviderSpec.js @@ -1,17 +1,17 @@ +import inherits from 'inherits-browser'; + import { bootstrapDiagram, inject -} from 'test/TestHelper'; +} from 'test/TestHelper.js'; -import testRulesModule from './rules'; -import sayNoRulesModule from './say-no-rules'; -import priorityRulesModule from './priority-rules'; -import rulesModule from 'lib/features/rules'; -import modelingModule from 'lib/features/modeling'; +import testRulesModule from './rules/index.js'; +import sayNoRulesModule from './say-no-rules/index.js'; +import priorityRulesModule from './priority-rules/index.js'; +import rulesModule from 'lib/features/rules/index.js'; +import modelingModule from 'lib/features/modeling/index.js'; -import RuleProvider from 'lib/features/rules/RuleProvider'; - -import inherits from 'inherits-browser'; +import RuleProvider from 'lib/features/rules/RuleProvider.js'; describe('features/rules - RuleProvider', function() { diff --git a/test/spec/features/rules/priority-rules/PriorityRules.js b/test/spec/features/rules/priority-rules/PriorityRules.js index 07c91b4ab..3b294df49 100755 --- a/test/spec/features/rules/priority-rules/PriorityRules.js +++ b/test/spec/features/rules/priority-rules/PriorityRules.js @@ -1,6 +1,6 @@ import inherits from 'inherits-browser'; -import RuleProvider from 'lib/features/rules/RuleProvider'; +import RuleProvider from 'lib/features/rules/RuleProvider.js'; var HIGH_PRIORITY = 1500; diff --git a/test/spec/features/rules/priority-rules/index.js b/test/spec/features/rules/priority-rules/index.js index 1e76621b3..5cda0388e 100755 --- a/test/spec/features/rules/priority-rules/index.js +++ b/test/spec/features/rules/priority-rules/index.js @@ -1,4 +1,4 @@ -import PriorityRules from './PriorityRules'; +import PriorityRules from './PriorityRules.js'; export default { __init__: [ 'priorityRules' ], diff --git a/test/spec/features/rules/rules/TestRules.js b/test/spec/features/rules/rules/TestRules.js index c5159dad1..7b5764762 100755 --- a/test/spec/features/rules/rules/TestRules.js +++ b/test/spec/features/rules/rules/TestRules.js @@ -1,6 +1,6 @@ import inherits from 'inherits-browser'; -import RuleProvider from 'lib/features/rules/RuleProvider'; +import RuleProvider from 'lib/features/rules/RuleProvider.js'; export default function TestRules(eventBus) { RuleProvider.call(this, eventBus); diff --git a/test/spec/features/rules/rules/index.js b/test/spec/features/rules/rules/index.js index eb8ffc77c..4dc6c034e 100755 --- a/test/spec/features/rules/rules/index.js +++ b/test/spec/features/rules/rules/index.js @@ -1,4 +1,4 @@ -import TestRules from './TestRules'; +import TestRules from './TestRules.js'; export default { __init__: [ 'testRules' ], diff --git a/test/spec/features/rules/say-no-rules/SayNoRules.js b/test/spec/features/rules/say-no-rules/SayNoRules.js index eb892a433..21c9db5d1 100755 --- a/test/spec/features/rules/say-no-rules/SayNoRules.js +++ b/test/spec/features/rules/say-no-rules/SayNoRules.js @@ -1,6 +1,6 @@ import inherits from 'inherits-browser'; -import RuleProvider from 'lib/features/rules/RuleProvider'; +import RuleProvider from 'lib/features/rules/RuleProvider.js'; export default function SayNoRules(eventBus) { RuleProvider.call(this, eventBus); diff --git a/test/spec/features/rules/say-no-rules/index.js b/test/spec/features/rules/say-no-rules/index.js index e63f2bb2c..709fdc0cf 100755 --- a/test/spec/features/rules/say-no-rules/index.js +++ b/test/spec/features/rules/say-no-rules/index.js @@ -1,4 +1,4 @@ -import SayNoRules from './SayNoRules'; +import SayNoRules from './SayNoRules.js'; export default { __init__: [ 'sayNoRules' ], diff --git a/test/spec/features/search-pad/SearchPadSpec.js b/test/spec/features/search-pad/SearchPadSpec.js index 9114431ee..18f06679d 100644 --- a/test/spec/features/search-pad/SearchPadSpec.js +++ b/test/spec/features/search-pad/SearchPadSpec.js @@ -1,14 +1,14 @@ import { bootstrapDiagram, inject -} from 'test/TestHelper'; +} from 'test/TestHelper.js'; import { createKeyEvent -} from 'test/util/KeyEvents'; +} from 'test/util/KeyEvents.js'; -import searchPadModule from 'lib/features/search-pad'; -import SearchPad from 'lib/features/search-pad/SearchPad'; +import searchPadModule from 'lib/features/search-pad/index.js'; +import SearchPad from 'lib/features/search-pad/SearchPad.js'; import { query as domQuery, diff --git a/test/spec/features/selection/SelectionBehaviorSpec.js b/test/spec/features/selection/SelectionBehaviorSpec.js index 0818a1628..bcb7de422 100644 --- a/test/spec/features/selection/SelectionBehaviorSpec.js +++ b/test/spec/features/selection/SelectionBehaviorSpec.js @@ -2,24 +2,24 @@ import { bootstrapDiagram, getDiagramJS, inject -} from 'test/TestHelper'; +} from 'test/TestHelper.js'; import { assign } from 'min-dash'; -import coreModule from 'lib/core'; -import createModule from 'lib/features/create'; -import draggingModule from 'lib/features/dragging'; -import modelingModule from 'lib/features/modeling'; -import moveModule from 'lib/features/move'; -import connectModule from 'lib/features/connect'; -import rulesModule from './rules'; -import selectionModule from 'lib/features/selection'; +import coreModule from 'lib/core/index.js'; +import createModule from 'lib/features/create/index.js'; +import draggingModule from 'lib/features/dragging/index.js'; +import modelingModule from 'lib/features/modeling/index.js'; +import moveModule from 'lib/features/move/index.js'; +import connectModule from 'lib/features/connect/index.js'; +import rulesModule from './rules/index.js'; +import selectionModule from 'lib/features/selection/index.js'; import { createCanvasEvent as canvasEvent -} from '../../../util/MockEvents'; +} from '../../../util/MockEvents.js'; describe('features/selection/Selection', function() { diff --git a/test/spec/features/selection/SelectionSpec.js b/test/spec/features/selection/SelectionSpec.js index 96e10cb89..71d9b1b00 100755 --- a/test/spec/features/selection/SelectionSpec.js +++ b/test/spec/features/selection/SelectionSpec.js @@ -1,16 +1,16 @@ import { bootstrapDiagram, inject -} from 'test/TestHelper'; - -import coreModule from 'lib/core'; -import createModule from 'lib/features/create'; -import draggingModule from 'lib/features/dragging'; -import modelingModule from 'lib/features/modeling'; -import moveModule from 'lib/features/move'; -import connectModule from 'lib/features/connect'; -import rulesModule from './rules'; -import selectionModule from 'lib/features/selection'; +} from 'test/TestHelper.js'; + +import coreModule from 'lib/core/index.js'; +import createModule from 'lib/features/create/index.js'; +import draggingModule from 'lib/features/dragging/index.js'; +import modelingModule from 'lib/features/modeling/index.js'; +import moveModule from 'lib/features/move/index.js'; +import connectModule from 'lib/features/connect/index.js'; +import rulesModule from './rules/index.js'; +import selectionModule from 'lib/features/selection/index.js'; describe('features/selection/Selection', function() { diff --git a/test/spec/features/selection/SelectionVisualsSpec.js b/test/spec/features/selection/SelectionVisualsSpec.js index 0c240afe8..2ca61e7d0 100755 --- a/test/spec/features/selection/SelectionVisualsSpec.js +++ b/test/spec/features/selection/SelectionVisualsSpec.js @@ -1,21 +1,21 @@ -import { - bootstrapDiagram, - inject -} from 'test/TestHelper'; - -import selectionModule from 'lib/features/selection'; -import modelingModule from 'lib/features/modeling'; - import { classes as domClasses, query as domQuery } from 'min-dom'; -import { getBBox } from 'lib/util/Elements'; +import { + bootstrapDiagram, + inject +} from 'test/TestHelper.js'; + +import selectionModule from 'lib/features/selection/index.js'; +import modelingModule from 'lib/features/modeling/index.js'; + +import { getBBox } from 'lib/util/Elements.js'; import { resizeBounds -} from 'lib/features/resize/ResizeUtil'; +} from 'lib/features/resize/ResizeUtil.js'; describe('features/selection/SelectionVisuals', function() { diff --git a/test/spec/features/selection/rules/ConnectRules.js b/test/spec/features/selection/rules/ConnectRules.js index ff2513454..1bd68b114 100755 --- a/test/spec/features/selection/rules/ConnectRules.js +++ b/test/spec/features/selection/rules/ConnectRules.js @@ -1,6 +1,6 @@ import inherits from 'inherits-browser'; -import RuleProvider from 'lib/features/rules/RuleProvider'; +import RuleProvider from 'lib/features/rules/RuleProvider.js'; export default function ConnectRules(eventBus) { RuleProvider.call(this, eventBus); diff --git a/test/spec/features/selection/rules/index.js b/test/spec/features/selection/rules/index.js index 5bd9b7fff..aac02c1c6 100755 --- a/test/spec/features/selection/rules/index.js +++ b/test/spec/features/selection/rules/index.js @@ -1,4 +1,4 @@ -import ConnectRules from './ConnectRules'; +import ConnectRules from './ConnectRules.js'; export default { __init__: [ 'connectRules' ], diff --git a/test/spec/features/snapping/SnappingSpec.js b/test/spec/features/snapping/SnappingSpec.js index daa10e4d7..10686a627 100755 --- a/test/spec/features/snapping/SnappingSpec.js +++ b/test/spec/features/snapping/SnappingSpec.js @@ -1,12 +1,12 @@ import { bootstrapDiagram, inject -} from 'test/TestHelper'; +} from 'test/TestHelper.js'; -import modelingModule from 'lib/features/modeling'; -import snappingModule from 'lib/features/snapping'; -import moveModule from 'lib/features/move'; +import modelingModule from 'lib/features/modeling/index.js'; +import snappingModule from 'lib/features/snapping/index.js'; +import moveModule from 'lib/features/move/index.js'; describe('features/snapping', function() { diff --git a/test/spec/features/space-tool/SpaceToolSpec.js b/test/spec/features/space-tool/SpaceToolSpec.js index 198ba8442..70cb40459 100644 --- a/test/spec/features/space-tool/SpaceToolSpec.js +++ b/test/spec/features/space-tool/SpaceToolSpec.js @@ -7,19 +7,19 @@ import { attr as svgAttr } from 'tiny-svg'; import { bootstrapDiagram, inject -} from 'test/TestHelper'; +} from 'test/TestHelper.js'; -import autoResizeModule from 'lib/features/auto-resize'; -import autoResizeProviderModule from './auto-resize'; -import modelingModule from 'lib/features/modeling'; -import rulesModule from './rules'; -import spaceToolModule from 'lib/features/space-tool'; +import autoResizeModule from 'lib/features/auto-resize/index.js'; +import autoResizeProviderModule from './auto-resize/index.js'; +import modelingModule from 'lib/features/modeling/index.js'; +import rulesModule from './rules/index.js'; +import spaceToolModule from 'lib/features/space-tool/index.js'; import { createCanvasEvent as canvasEvent -} from '../../../util/MockEvents'; +} from '../../../util/MockEvents.js'; -import { isMac } from 'lib/util/Platform'; +import { isMac } from 'lib/util/Platform.js'; var keyModifier = isMac() ? { metaKey: true } : { ctrlKey: true }; diff --git a/test/spec/features/space-tool/auto-resize/CustomAutoResizeProvider.js b/test/spec/features/space-tool/auto-resize/CustomAutoResizeProvider.js index e44ac8e27..58aa6c6a8 100644 --- a/test/spec/features/space-tool/auto-resize/CustomAutoResizeProvider.js +++ b/test/spec/features/space-tool/auto-resize/CustomAutoResizeProvider.js @@ -1,6 +1,6 @@ import inherits from 'inherits-browser'; -import AutoResizeProvider from 'lib/features/auto-resize/AutoResizeProvider'; +import AutoResizeProvider from 'lib/features/auto-resize/AutoResizeProvider.js'; export default function CustomAutoResizeProvider(eventBus) { diff --git a/test/spec/features/space-tool/auto-resize/index.js b/test/spec/features/space-tool/auto-resize/index.js index 117bac0fd..7a74cc7fd 100644 --- a/test/spec/features/space-tool/auto-resize/index.js +++ b/test/spec/features/space-tool/auto-resize/index.js @@ -1,4 +1,4 @@ -import CustomAutoResizeProvider from './CustomAutoResizeProvider'; +import CustomAutoResizeProvider from './CustomAutoResizeProvider.js'; export default { __init__: [ 'customAutoResizeProvider' ], diff --git a/test/spec/features/space-tool/rules/SpaceToolRules.js b/test/spec/features/space-tool/rules/SpaceToolRules.js index 51f90ec4d..d1ba05dc4 100644 --- a/test/spec/features/space-tool/rules/SpaceToolRules.js +++ b/test/spec/features/space-tool/rules/SpaceToolRules.js @@ -1,6 +1,6 @@ import inherits from 'inherits-browser'; -import RuleProvider from 'lib/features/rules/RuleProvider'; +import RuleProvider from 'lib/features/rules/RuleProvider.js'; export default function SpaceToolRules(eventBus) { RuleProvider.call(this, eventBus); diff --git a/test/spec/features/space-tool/rules/index.js b/test/spec/features/space-tool/rules/index.js index 73ec1914c..d25b153bc 100644 --- a/test/spec/features/space-tool/rules/index.js +++ b/test/spec/features/space-tool/rules/index.js @@ -1,4 +1,4 @@ -import SpaceToolRules from './SpaceToolRules'; +import SpaceToolRules from './SpaceToolRules.js'; export default { __init__: [ 'spaceToolRules' ], diff --git a/test/spec/features/tool-manager/ToolManagerSpec.js b/test/spec/features/tool-manager/ToolManagerSpec.js index ce74cafd2..a503c8bb6 100644 --- a/test/spec/features/tool-manager/ToolManagerSpec.js +++ b/test/spec/features/tool-manager/ToolManagerSpec.js @@ -1,25 +1,32 @@ import { bootstrapDiagram, inject -} from 'test/TestHelper'; +} from 'test/TestHelper.js'; import { createCanvasEvent as canvasEvent -} from '../../../util/MockEvents'; +} from '../../../util/MockEvents.js'; -import toolManagerModule from 'lib/features/tool-manager'; -import handToolModule from 'lib/features/hand-tool'; -import draggingModule from 'lib/features/dragging'; +import toolManagerModule from 'lib/features/tool-manager/index.js'; +import handToolModule from 'lib/features/hand-tool/index.js'; +import draggingModule from 'lib/features/dragging/index.js'; describe('features/tool-manager', function() { - beforeEach(bootstrapDiagram({ modules: [ toolManagerModule, handToolModule, draggingModule ] })); + beforeEach(bootstrapDiagram({ + modules: [ + toolManagerModule, + handToolModule, + draggingModule + ] + })); beforeEach(inject(function(dragging) { dragging.setOptions({ manual: true }); })); + describe('basics', function() { it('should register a tool', inject(function(toolManager) { diff --git a/test/spec/features/tooltips/TooltipsSpec.js b/test/spec/features/tooltips/TooltipsSpec.js index ebcc43eff..42ef4ef69 100644 --- a/test/spec/features/tooltips/TooltipsSpec.js +++ b/test/spec/features/tooltips/TooltipsSpec.js @@ -1,8 +1,3 @@ -import { - bootstrapDiagram, - inject -} from 'test/TestHelper'; - import { forEach } from 'min-dash'; @@ -12,7 +7,12 @@ import { assignStyle } from 'min-dom'; -import tooltipsModule from 'lib/features/tooltips'; +import { + bootstrapDiagram, + inject +} from 'test/TestHelper.js'; + +import tooltipsModule from 'lib/features/tooltips/index.js'; describe('features/tooltips', function() { diff --git a/test/spec/i18n/I18NSpec.js b/test/spec/i18n/I18NSpec.js index 4898581c6..f4ca64d7d 100644 --- a/test/spec/i18n/I18NSpec.js +++ b/test/spec/i18n/I18NSpec.js @@ -1,10 +1,10 @@ import { bootstrapDiagram, inject -} from 'test/TestHelper'; +} from 'test/TestHelper.js'; -import paletteModule from 'lib/features/palette'; -import i18nModule from 'lib/i18n'; +import paletteModule from 'lib/features/palette/index.js'; +import i18nModule from 'lib/i18n/index.js'; describe('i18n', function() { diff --git a/test/spec/i18n/translate/custom-translate/custom-translate.js b/test/spec/i18n/translate/custom-translate/custom-translate.js index 1ca8f2d44..ecc8333a5 100644 --- a/test/spec/i18n/translate/custom-translate/custom-translate.js +++ b/test/spec/i18n/translate/custom-translate/custom-translate.js @@ -1,4 +1,4 @@ -import translate from 'lib/i18n/translate/translate'; +import translate from 'lib/i18n/translate/translate.js'; export default function customTranslate(template, replacements) { if (template === 'Remove') { diff --git a/test/spec/i18n/translate/custom-translate/index.js b/test/spec/i18n/translate/custom-translate/index.js index 555037942..9cdd5988e 100644 --- a/test/spec/i18n/translate/custom-translate/index.js +++ b/test/spec/i18n/translate/custom-translate/index.js @@ -1,4 +1,4 @@ -import customTranslate from './custom-translate'; +import customTranslate from './custom-translate.js'; export default { translate: [ 'value', customTranslate ] diff --git a/test/spec/i18n/translate/translateSpec.js b/test/spec/i18n/translate/translateSpec.js index d2d39b76b..c87f57243 100644 --- a/test/spec/i18n/translate/translateSpec.js +++ b/test/spec/i18n/translate/translateSpec.js @@ -1,10 +1,10 @@ import { bootstrapDiagram, inject -} from 'test/TestHelper'; +} from 'test/TestHelper.js'; -import translateModule from 'lib/i18n/translate'; -import customTranslateModule from './custom-translate'; +import translateModule from 'lib/i18n/translate/index.js'; +import customTranslateModule from './custom-translate/index.js'; describe('i18n - translate', function() { diff --git a/test/spec/layout/CroppingConnectionDockingSpec.js b/test/spec/layout/CroppingConnectionDockingSpec.js index b781bffff..20bfdbdd8 100755 --- a/test/spec/layout/CroppingConnectionDockingSpec.js +++ b/test/spec/layout/CroppingConnectionDockingSpec.js @@ -2,7 +2,7 @@ import { bootstrapDiagram, getDiagramJS, inject -} from 'test/TestHelper'; +} from 'test/TestHelper.js'; import { append as svgAppend, @@ -10,7 +10,7 @@ import { create as svgCreate } from 'tiny-svg'; -import CroppingConnectionDocking from 'lib/layout/CroppingConnectionDocking'; +import CroppingConnectionDocking from 'lib/layout/CroppingConnectionDocking.js'; var layoutModule = { connectionDocking: [ 'type', CroppingConnectionDocking ] diff --git a/test/spec/layout/LayoutUtilSpec.js b/test/spec/layout/LayoutUtilSpec.js index a05ae2818..e925f59d2 100755 --- a/test/spec/layout/LayoutUtilSpec.js +++ b/test/spec/layout/LayoutUtilSpec.js @@ -2,7 +2,7 @@ import { filterRedundantWaypoints, getOrientation, getMid -} from 'lib/layout/LayoutUtil'; +} from 'lib/layout/LayoutUtil.js'; function rect(x, y, width, height) { diff --git a/test/spec/layout/ManhattanLayoutSpec.js b/test/spec/layout/ManhattanLayoutSpec.js index bdd8b5e1a..5f3745e08 100755 --- a/test/spec/layout/ManhattanLayoutSpec.js +++ b/test/spec/layout/ManhattanLayoutSpec.js @@ -2,7 +2,7 @@ import { connectRectangles, connectPoints, repairConnection -} from 'lib/layout/ManhattanLayout'; +} from 'lib/layout/ManhattanLayout.js'; function point(x, y) { diff --git a/test/spec/model/ModelSpec.js b/test/spec/model/ModelSpec.js index abccfe44b..32d01180b 100644 --- a/test/spec/model/ModelSpec.js +++ b/test/spec/model/ModelSpec.js @@ -1,13 +1,14 @@ import { create, isModelElement -} from 'lib/model'; +} from 'lib/model/index.js'; import { isConnection, isLabel, isRoot -} from '../../../lib/util/ModelUtil'; +} from 'lib/util/ModelUtil.js'; + describe('model', function() { diff --git a/test/spec/navigation/keyboard-move/KeyboardMoveSpec.js b/test/spec/navigation/keyboard-move/KeyboardMoveSpec.js index 36e4a5e3b..b6ed0d67a 100755 --- a/test/spec/navigation/keyboard-move/KeyboardMoveSpec.js +++ b/test/spec/navigation/keyboard-move/KeyboardMoveSpec.js @@ -1,18 +1,18 @@ +import { + assign, + forEach +} from 'min-dash'; + import { bootstrapDiagram, getDiagramJS, inject -} from 'test/TestHelper'; +} from 'test/TestHelper.js'; -import { createKeyEvent } from 'test/util/KeyEvents'; - -import { - assign, - forEach -} from 'min-dash'; +import { createKeyEvent } from 'test/util/KeyEvents.js'; -import modelingModule from 'lib/features/modeling'; -import keyboardMoveModule from 'lib/navigation/keyboard-move'; +import modelingModule from 'lib/features/modeling/index.js'; +import keyboardMoveModule from 'lib/navigation/keyboard-move/index.js'; describe('navigation/keyboard-move', function() { diff --git a/test/spec/navigation/movecanvas/MoveCanvasSpec.js b/test/spec/navigation/movecanvas/MoveCanvasSpec.js index 2829fb9e1..d569cfaf7 100755 --- a/test/spec/navigation/movecanvas/MoveCanvasSpec.js +++ b/test/spec/navigation/movecanvas/MoveCanvasSpec.js @@ -1,15 +1,15 @@ +import { + assign +} from 'min-dash'; + import { bootstrapDiagram, getDiagramJS, inject -} from 'test/TestHelper'; - -import { - assign -} from 'min-dash'; +} from 'test/TestHelper.js'; -import moveCanvasModule from 'lib/navigation/movecanvas'; -import interactionEventsModule from 'lib/features/interaction-events'; +import moveCanvasModule from 'lib/navigation/movecanvas/index.js'; +import interactionEventsModule from 'lib/features/interaction-events/index.js'; describe('navigation/movecanvas', function() { diff --git a/test/spec/navigation/zoomscoll/ZoomScrollSpec.js b/test/spec/navigation/zoomscoll/ZoomScrollSpec.js index 5dfcbd74a..0c1893333 100644 --- a/test/spec/navigation/zoomscoll/ZoomScrollSpec.js +++ b/test/spec/navigation/zoomscoll/ZoomScrollSpec.js @@ -1,9 +1,3 @@ -import { - bootstrapDiagram, - getDiagramJS, - inject -} from 'test/TestHelper'; - import { assign } from 'min-dash'; @@ -12,7 +6,13 @@ import { domify } from 'min-dom'; -import zoomScrollModule from 'lib/navigation/zoomscroll'; +import { + bootstrapDiagram, + getDiagramJS, + inject +} from 'test/TestHelper.js'; + +import zoomScrollModule from 'lib/navigation/zoomscroll/index.js'; describe('navigation/zoomscroll', function() { diff --git a/test/spec/snapping/CreateMoveSnappingSpec.js b/test/spec/snapping/CreateMoveSnappingSpec.js index 0606966ad..c0b5712a1 100644 --- a/test/spec/snapping/CreateMoveSnappingSpec.js +++ b/test/spec/snapping/CreateMoveSnappingSpec.js @@ -1,24 +1,24 @@ import { bootstrapDiagram, inject -} from 'test/TestHelper'; +} from 'test/TestHelper.js'; -import createModule from 'lib/features/create'; -import modelingModule from 'lib/features/modeling'; -import moveModule from 'lib/features/move'; -import snappingModule from 'lib/features/snapping'; +import createModule from 'lib/features/create/index.js'; +import modelingModule from 'lib/features/modeling/index.js'; +import moveModule from 'lib/features/move/index.js'; +import snappingModule from 'lib/features/snapping/index.js'; -import SnapContext from 'lib/features/snapping/SnapContext'; +import SnapContext from 'lib/features/snapping/SnapContext.js'; import { bottomRight, mid, topLeft -} from 'lib/features/snapping/SnapUtil'; +} from 'lib/features/snapping/SnapUtil.js'; import { createCanvasEvent as canvasEventMid -} from '../../util/MockEvents'; +} from '../../util/MockEvents.js'; describe('features/snapping - CreateMoveSnapping', function() { diff --git a/test/spec/snapping/ResizeSnappingSpec.js b/test/spec/snapping/ResizeSnappingSpec.js index 1466c47d2..623e544ff 100644 --- a/test/spec/snapping/ResizeSnappingSpec.js +++ b/test/spec/snapping/ResizeSnappingSpec.js @@ -1,19 +1,19 @@ import { bootstrapDiagram, inject -} from 'test/TestHelper'; +} from 'test/TestHelper.js'; -import modelingModule from 'lib/features/modeling'; -import resizeModule from 'lib/features/resize'; -import snappingModule from 'lib/features/snapping'; +import modelingModule from 'lib/features/modeling/index.js'; +import resizeModule from 'lib/features/resize/index.js'; +import snappingModule from 'lib/features/snapping/index.js'; -import SnapContext from 'lib/features/snapping/SnapContext'; +import SnapContext from 'lib/features/snapping/SnapContext.js'; -import { getReferencePoint } from 'lib/features/resize/Resize'; +import { getReferencePoint } from 'lib/features/resize/Resize.js'; import { createCanvasEvent as canvasEvent -} from '../../util/MockEvents'; +} from '../../util/MockEvents.js'; var VERY_LOW_PRIORITY = 100; diff --git a/test/spec/snapping/SnapContextSpec.js b/test/spec/snapping/SnapContextSpec.js index 5fbeb3e05..597162ad7 100644 --- a/test/spec/snapping/SnapContextSpec.js +++ b/test/spec/snapping/SnapContextSpec.js @@ -1,4 +1,4 @@ -import SnapContext from 'lib/features/snapping/SnapContext'; +import SnapContext from 'lib/features/snapping/SnapContext.js'; describe('snapping - SnapContext', function() { diff --git a/test/spec/snapping/SnapUtilSpec.js b/test/spec/snapping/SnapUtilSpec.js index 853920f3e..e1179f1c9 100644 --- a/test/spec/snapping/SnapUtilSpec.js +++ b/test/spec/snapping/SnapUtilSpec.js @@ -1,11 +1,11 @@ import { bootstrapDiagram, inject -} from 'test/TestHelper'; +} from 'test/TestHelper.js'; -import modelingModule from 'lib/features/modeling'; +import modelingModule from 'lib/features/modeling/index.js'; -import { getChildren } from 'lib/features/snapping/SnapUtil'; +import { getChildren } from 'lib/features/snapping/SnapUtil.js'; describe('features/snapping - SnapUtil', function() { diff --git a/test/spec/snapping/SnappingSpec.js b/test/spec/snapping/SnappingSpec.js index bbcf3b9ea..277f6cae5 100644 --- a/test/spec/snapping/SnappingSpec.js +++ b/test/spec/snapping/SnappingSpec.js @@ -4,14 +4,14 @@ import { bootstrapDiagram, getDiagramJS, inject -} from 'test/TestHelper'; +} from 'test/TestHelper.js'; -import modelingModule from 'lib/features/modeling'; -import snappingModule from 'lib/features/snapping'; +import modelingModule from 'lib/features/modeling/index.js'; +import snappingModule from 'lib/features/snapping/index.js'; -import SnapContext, { SnapPoints } from 'lib/features/snapping/SnapContext'; +import SnapContext, { SnapPoints } from 'lib/features/snapping/SnapContext.js'; -import { SNAP_LINE_HIDE_DELAY } from 'lib/features/snapping/Snapping'; +import { SNAP_LINE_HIDE_DELAY } from 'lib/features/snapping/Snapping.js'; import { queryAll as domQueryAll } from 'min-dom'; diff --git a/test/spec/ui/uiSpec.js b/test/spec/ui/uiSpec.js index 4802aa1ed..f9f147c75 100644 --- a/test/spec/ui/uiSpec.js +++ b/test/spec/ui/uiSpec.js @@ -2,7 +2,7 @@ import { html, render, useState -} from 'lib/ui'; +} from 'lib/ui/index.js'; describe('ui', function() { diff --git a/test/spec/util/AttachUtilSpec.js b/test/spec/util/AttachUtilSpec.js index 3d6732907..1a62a3a4b 100644 --- a/test/spec/util/AttachUtilSpec.js +++ b/test/spec/util/AttachUtilSpec.js @@ -1,6 +1,6 @@ import { getNewAttachPoint -} from 'lib/util/AttachUtil'; +} from 'lib/util/AttachUtil.js'; describe('AttachUtil', function() { diff --git a/test/spec/util/ElementIntegrationSpec.js b/test/spec/util/ElementIntegrationSpec.js index 9d2c1fe35..18f98d18d 100644 --- a/test/spec/util/ElementIntegrationSpec.js +++ b/test/spec/util/ElementIntegrationSpec.js @@ -1,7 +1,7 @@ import { bootstrapDiagram, inject -} from 'test/TestHelper'; +} from 'test/TestHelper.js'; import { keys @@ -9,9 +9,9 @@ import { import { getEnclosedElements -} from 'lib/util/Elements'; +} from 'lib/util/Elements.js'; -import modelingModule from 'lib/features/modeling'; +import modelingModule from 'lib/features/modeling/index.js'; describe('util/Elements', function() { diff --git a/test/spec/util/ElementsSpec.js b/test/spec/util/ElementsSpec.js index 1f09a5148..9f8b666a2 100755 --- a/test/spec/util/ElementsSpec.js +++ b/test/spec/util/ElementsSpec.js @@ -5,7 +5,7 @@ import { getClosure, getParents, isFrameElement -} from 'lib/util/Elements'; +} from 'lib/util/Elements.js'; describe('util/Elements', function() { diff --git a/test/spec/util/EscapeUtilSpec.js b/test/spec/util/EscapeUtilSpec.js index 44e362c6d..139b501a5 100644 --- a/test/spec/util/EscapeUtilSpec.js +++ b/test/spec/util/EscapeUtilSpec.js @@ -1,7 +1,7 @@ import { escapeCSS, escapeHTML -} from 'lib/util/EscapeUtil'; +} from 'lib/util/EscapeUtil.js'; describe('util/EscapeUtil', function() { diff --git a/test/spec/util/GeometrySpec.js b/test/spec/util/GeometrySpec.js index fcbef9d02..bc5c25c94 100644 --- a/test/spec/util/GeometrySpec.js +++ b/test/spec/util/GeometrySpec.js @@ -1,7 +1,7 @@ import { pointsOnLine, pointsAligned -} from 'lib/util/Geometry'; +} from 'lib/util/Geometry.js'; describe('util/Geometry', function() { diff --git a/test/spec/util/IdGeneratorSpec.js b/test/spec/util/IdGeneratorSpec.js index 580c1f4a3..995b126a7 100755 --- a/test/spec/util/IdGeneratorSpec.js +++ b/test/spec/util/IdGeneratorSpec.js @@ -1,4 +1,4 @@ -import IdGenerator from 'lib/util/IdGenerator'; +import IdGenerator from 'lib/util/IdGenerator.js'; describe('util/IdGenerator', function() { diff --git a/test/spec/util/LineIntersectionSpec.js b/test/spec/util/LineIntersectionSpec.js index 407b4796f..d625fc14e 100755 --- a/test/spec/util/LineIntersectionSpec.js +++ b/test/spec/util/LineIntersectionSpec.js @@ -1,6 +1,6 @@ import { getApproxIntersection -} from 'lib/util/LineIntersection'; +} from 'lib/util/LineIntersection.js'; describe('features/bendpoints - LineIntersection', function() { diff --git a/test/spec/util/RenderUtilSpec.js b/test/spec/util/RenderUtilSpec.js index 6c5be3ffa..e4dd1d7c0 100644 --- a/test/spec/util/RenderUtilSpec.js +++ b/test/spec/util/RenderUtilSpec.js @@ -1,7 +1,7 @@ import { createLine, updateLine -} from 'lib/util/RenderUtil'; +} from 'lib/util/RenderUtil.js'; import { attr as svgAttr diff --git a/test/spec/util/TextSpec.js b/test/spec/util/TextSpec.js index 25c87b32d..e59a3dadb 100644 --- a/test/spec/util/TextSpec.js +++ b/test/spec/util/TextSpec.js @@ -10,7 +10,7 @@ import { } from 'tiny-svg'; -import TextUtil from 'lib/util/Text'; +import TextUtil from 'lib/util/Text.js'; import TestContainer from 'mocha-test-container-support'; diff --git a/test/util/MockEvents.js b/test/util/MockEvents.js index d520a630d..9abb59b08 100644 --- a/test/util/MockEvents.js +++ b/test/util/MockEvents.js @@ -2,10 +2,10 @@ import { assign } from 'min-dash'; import { getDiagramJS -} from 'test/TestHelper'; +} from '../TestHelper.js'; /** - * @typedef {import('../../lib/util/Types').Point} Point + * @typedef {import('../../lib/util/Types.js').Point} Point */ /**