summaryrefslogtreecommitdiffstats
path: root/packages/kadira-flow-router/test/common/router.addons.spec.js
diff options
context:
space:
mode:
authorLauri Ojansivu <x@xet7.org>2019-04-20 15:18:33 +0300
committerLauri Ojansivu <x@xet7.org>2019-04-20 15:18:33 +0300
commit73e265d8fd050ae3daa67472b4465a5c49d68910 (patch)
tree677b233934a43d8f873e24c794ce289d85e3a9b7 /packages/kadira-flow-router/test/common/router.addons.spec.js
parent6117097a93bfb11c8bd4c87a23c44a50e22ceb87 (diff)
downloadwekan-73e265d8fd050ae3daa67472b4465a5c49d68910.tar.gz
wekan-73e265d8fd050ae3daa67472b4465a5c49d68910.tar.bz2
wekan-73e265d8fd050ae3daa67472b4465a5c49d68910.zip
Include to Wekan packages directory contents, so that meteor command would build all directly.
This also simplifies build scripts. Thanks to xet7 !
Diffstat (limited to 'packages/kadira-flow-router/test/common/router.addons.spec.js')
-rw-r--r--packages/kadira-flow-router/test/common/router.addons.spec.js30
1 files changed, 30 insertions, 0 deletions
diff --git a/packages/kadira-flow-router/test/common/router.addons.spec.js b/packages/kadira-flow-router/test/common/router.addons.spec.js
new file mode 100644
index 00000000..f5078734
--- /dev/null
+++ b/packages/kadira-flow-router/test/common/router.addons.spec.js
@@ -0,0 +1,30 @@
+Router = FlowRouter.Router;
+
+Tinytest.addAsync('Common - Addons - onRouteRegister basic usage', function (test, done) {
+ var name = Random.id();
+ var customField = Random.id();
+ var pathDef = '/' + name;
+
+ FlowRouter.onRouteRegister(function(route) {
+ test.equal(route, {
+ pathDef: pathDef,
+
+ // Route.path is deprecated and will be removed in 3.0
+ path: pathDef,
+
+ name: name,
+ options: {customField: customField}
+ });
+ FlowRouter._onRouteCallbacks = [];
+ done();
+ });
+
+ FlowRouter.route(pathDef, {
+ name: name,
+ action: function() {},
+ subscriptions: function() {},
+ triggersEnter: function() {},
+ triggersExit: function() {},
+ customField: customField
+ });
+});