|
|
@ -12,7 +12,7 @@ module.exports.tests.text_parser = function(test, common) { |
|
|
|
}}); |
|
|
|
}}); |
|
|
|
|
|
|
|
|
|
|
|
const raw = { |
|
|
|
const raw = { |
|
|
|
query: ' \t query \t value \t ', |
|
|
|
venue: ' \t venue \t value \t ', |
|
|
|
neighbourhood: ' \t neighbourhood \t value \t ', |
|
|
|
neighbourhood: ' \t neighbourhood \t value \t ', |
|
|
|
borough: ' \t borough \t value \t ', |
|
|
|
borough: ' \t borough \t value \t ', |
|
|
|
locality: ' \t locality \t value \t ', |
|
|
|
locality: ' \t locality \t value \t ', |
|
|
@ -26,7 +26,7 @@ module.exports.tests.text_parser = function(test, common) { |
|
|
|
|
|
|
|
|
|
|
|
const expected_clean = { |
|
|
|
const expected_clean = { |
|
|
|
parsed_text: { |
|
|
|
parsed_text: { |
|
|
|
query: 'query value', |
|
|
|
query: 'venue value', |
|
|
|
neighbourhood: 'neighbourhood value', |
|
|
|
neighbourhood: 'neighbourhood value', |
|
|
|
borough: 'borough value', |
|
|
|
borough: 'borough value', |
|
|
|
city: 'locality value', |
|
|
|
city: 'locality value', |
|
|
@ -59,7 +59,7 @@ module.exports.tests.text_parser = function(test, common) { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const raw = { |
|
|
|
const raw = { |
|
|
|
query: getInvalidValue(), |
|
|
|
venue: getInvalidValue(), |
|
|
|
address: getInvalidValue(), |
|
|
|
address: getInvalidValue(), |
|
|
|
neighbourhood: getInvalidValue(), |
|
|
|
neighbourhood: getInvalidValue(), |
|
|
|
borough: getInvalidValue(), |
|
|
|
borough: getInvalidValue(), |
|
|
@ -80,7 +80,7 @@ module.exports.tests.text_parser = function(test, common) { |
|
|
|
|
|
|
|
|
|
|
|
t.deepEquals(clean, expected_clean); |
|
|
|
t.deepEquals(clean, expected_clean); |
|
|
|
t.deepEquals(messages.errors, ['at least one of the following fields is required: ' + |
|
|
|
t.deepEquals(messages.errors, ['at least one of the following fields is required: ' + |
|
|
|
'query, address, neighbourhood, borough, locality, county, region, postalcode, country'], 'no errors'); |
|
|
|
'venue, address, neighbourhood, borough, locality, county, region, postalcode, country'], 'no errors'); |
|
|
|
t.deepEquals(messages.warnings, [], 'no warnings'); |
|
|
|
t.deepEquals(messages.warnings, [], 'no warnings'); |
|
|
|
t.end(); |
|
|
|
t.end(); |
|
|
|
|
|
|
|
|
|
|
@ -103,7 +103,7 @@ module.exports.tests.text_parser = function(test, common) { |
|
|
|
|
|
|
|
|
|
|
|
t.deepEquals(clean, expected_clean); |
|
|
|
t.deepEquals(clean, expected_clean); |
|
|
|
t.deepEquals(messages.errors, ['at least one of the following fields is required: ' + |
|
|
|
t.deepEquals(messages.errors, ['at least one of the following fields is required: ' + |
|
|
|
'query, address, neighbourhood, borough, locality, county, region, postalcode, country'], 'no errors'); |
|
|
|
'venue, address, neighbourhood, borough, locality, county, region, postalcode, country'], 'no errors'); |
|
|
|
t.deepEquals(messages.warnings, [], 'no warnings'); |
|
|
|
t.deepEquals(messages.warnings, [], 'no warnings'); |
|
|
|
t.end(); |
|
|
|
t.end(); |
|
|
|
|
|
|
|
|
|
|
|