mirror of
https://github.com/node-red/node-red-nodes.git
synced 2025-03-01 10:37:43 +00:00
update rest of parsers to allow property to be selected
This commit is contained in:
@@ -1,3 +1,18 @@
|
||||
/**
|
||||
* Copyright 2015 IBM Corp.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
**/
|
||||
|
||||
var should = require("should");
|
||||
var helper = require('../../../test/helper.js');
|
||||
@@ -129,7 +144,7 @@ describe('geohash node', function() {
|
||||
});
|
||||
|
||||
it('should convert location lat, lon to geohash', function(done) {
|
||||
var flow = [{"id":"n1", "type":"geohash", func:"geohash", gap:0, wires:[["n2"]] },
|
||||
var flow = [{id:"n1", type:"geohash", func:"geohash", property:"location", gap:0, wires:[["n2"]] },
|
||||
{id:"n2", type:"helper"} ];
|
||||
helper.load(testNode, flow, function() {
|
||||
var n1 = helper.getNode("n1");
|
||||
@@ -144,7 +159,7 @@ describe('geohash node', function() {
|
||||
});
|
||||
|
||||
it('should convert location lat, lon to geohash (low precision)', function(done) {
|
||||
var flow = [{"id":"n1", "type":"geohash", func:"geohash", gap:0, wires:[["n2"]] },
|
||||
var flow = [{"id":"n1", "type":"geohash", func:"geohash", property:"location", gap:0, wires:[["n2"]] },
|
||||
{id:"n2", type:"helper"} ];
|
||||
helper.load(testNode, flow, function() {
|
||||
var n1 = helper.getNode("n1");
|
||||
@@ -159,7 +174,7 @@ describe('geohash node', function() {
|
||||
});
|
||||
|
||||
it('should convert location geohash to lat.lon', function(done) {
|
||||
var flow = [{"id":"n1", "type":"geohash", func:"geohash", gap:0, wires:[["n2"]] },
|
||||
var flow = [{"id":"n1", "type":"geohash", func:"geohash", property:"location", gap:0, wires:[["n2"]] },
|
||||
{id:"n2", type:"helper"} ];
|
||||
helper.load(testNode, flow, function() {
|
||||
var n1 = helper.getNode("n1");
|
||||
@@ -289,7 +304,7 @@ describe('geohash node', function() {
|
||||
});
|
||||
|
||||
it('should warn if location object with only a lat (or lon)', function(done) {
|
||||
var flow = [{"id":"n1", "type":"geohash", func:"gap", gap:10, wires:[["n2"]] },
|
||||
var flow = [{"id":"n1", "type":"geohash", func:"gap", property:"location", gap:10, wires:[["n2"]] },
|
||||
{id:"n2", type:"helper"} ];
|
||||
helper.load(testNode, flow, function() {
|
||||
var n1 = helper.getNode("n1");
|
||||
|
Reference in New Issue
Block a user