2018-02-26 16:56:14 +00:00
2018-11-11 17:47:03 +00:00
const { reduceExplore , reduceYelp , reduceFullFS , reducePhotos } = require ( '../server/reducers/rightbyme' ) ;
2018-02-26 16:56:14 +00:00
const expect = require ( 'expect.js' ) ;
2018-11-11 17:47:03 +00:00
const jsonfile = require ( 'jsonfile' ) ;
2018-02-26 16:56:14 +00:00
const exploreFS = {
'id' : '4c233b549a67a5937ea7dd87' ,
'name' : 'Cruachan Power Station' ,
'contact' : {
'phone' : '+441866822618' ,
'formattedPhone' : '+44 1866 822618'
} ,
'location' : {
'address' : 'A85' ,
'lat' : 56.39449115920086 ,
'lng' : - 5.1161516920810755 ,
'labeledLatLngs' : [
{
'label' : 'display' ,
'lat' : 56.39449115920086 ,
'lng' : - 5.1161516920810755
}
] ,
'distance' : 30 ,
'postalCode' : 'PA33 1AN' ,
'cc' : 'GB' ,
'city' : 'Dalmally' ,
'country' : 'United Kingdom' ,
'formattedAddress' : [
'A85' ,
'Dalmally' ,
'PA33 1AN' ,
'United Kingdom'
]
} ,
'categories' : [
{
'id' : '4bf58dd8d48988d130941735' ,
'name' : 'Building' ,
'pluralName' : 'Buildings' ,
'shortName' : 'Building' ,
'icon' : {
'prefix' : 'https://ss3.4sqi.net/img/categories_v2/building/default_' ,
'suffix' : '.png'
} ,
'primary' : true
}
] ,
'verified' : false ,
'stats' : {
'tipCount' : 2 ,
'usersCount' : 98 ,
'checkinsCount' : 100
} ,
'url' : 'http://www.visitcruachan.co.uk' ,
'venueRatingBlacklisted' : true ,
'beenHere' : {
'count' : 0 ,
'marked' : false ,
'lastCheckinExpiredAt' : 0
} ,
'photos' : {
'count' : 0 ,
'groups' : [ ]
} ,
'hereNow' : {
'count' : 0 ,
'summary' : 'Nobody here' ,
'groups' : [ ]
}
} ;
const YelpData = {
'id' : 'cruachan-power-station-visitor-centre-dalmally' ,
'name' : 'Cruachan Power Station Visitor Centre' ,
'image_url' : 'https://s3-media2.fl.yelpcdn.com/bphoto/eRvbe7h4JBGQB5g1P0iWFg/o.jpg' ,
'is_closed' : false ,
'url' : 'https://www.yelp.com/biz/cruachan-power-station-visitor-centre-dalmally?adjust_creative=s8FdwjzKWCpdbkUzShvAgg&utm_campaign=yelp_api_v3&utm_medium=api_v3_business_search&utm_source=s8FdwjzKWCpdbkUzShvAgg' ,
'review_count' : 2 ,
'categories' : [
{
'alias' : 'visitorcenters' ,
'title' : 'Visitor Centers'
}
] ,
'rating' : 4.5 ,
'coordinates' : {
'latitude' : 56.394515 ,
'longitude' : - 5.116196
} ,
'transactions' : [ ] ,
'location' : {
'address1' : 'Cruachan Power Station' ,
'address2' : null ,
'address3' : null ,
'city' : 'Dalmally' ,
'zip_code' : 'PA33 1AN' ,
'country' : 'GB' ,
'state' : 'AGB' ,
'display_address' : [
'Cruachan Power Station' ,
'Dalmally PA33 1AN' ,
'United Kingdom'
]
} ,
'phone' : '+441866822618' ,
'display_phone' : '+44 1866 822618' ,
'distance' : 2.360238088184
} ;
const fullFS = {
'id' : '4c233b549a67a5937ea7dd87' ,
'name' : 'Cruachan Power Station' ,
'contact' : {
'phone' : '+441866822618' ,
'formattedPhone' : '+44 1866 822618'
} ,
'location' : {
'address' : 'A85' ,
'lat' : 56.39449115920086 ,
'lng' : - 5.1161516920810755 ,
'labeledLatLngs' : [
{
'label' : 'display' ,
'lat' : 56.39449115920086 ,
'lng' : - 5.1161516920810755
}
] ,
'postalCode' : 'PA33 1AN' ,
'cc' : 'GB' ,
'city' : 'Dalmally' ,
'country' : 'United Kingdom' ,
'formattedAddress' : [
'A85' ,
'Dalmally' ,
'PA33 1AN' ,
'United Kingdom'
]
} ,
'canonicalUrl' : 'https://foursquare.com/v/cruachan-power-station/4c233b549a67a5937ea7dd87' ,
'categories' : [
{
'id' : '4bf58dd8d48988d130941735' ,
'name' : 'Building' ,
'pluralName' : 'Buildings' ,
'shortName' : 'Building' ,
'icon' : {
'prefix' : 'https://ss3.4sqi.net/img/categories_v2/building/default_' ,
'suffix' : '.png'
} ,
'primary' : true
} ,
{
'id' : '4bf58dd8d48988d165941735' ,
'name' : 'Scenic Lookout' ,
'pluralName' : 'Scenic Lookouts' ,
'shortName' : 'Scenic Lookout' ,
'icon' : {
'prefix' : 'https://ss3.4sqi.net/img/categories_v2/parks_outdoors/sceniclookout_' ,
'suffix' : '.png'
}
}
] ,
'verified' : false ,
'stats' : {
'tipCount' : 2 ,
'usersCount' : 146 ,
'checkinsCount' : 100 ,
'visitsCount' : 150
} ,
'url' : 'http://www.visitcruachan.co.uk' ,
'likes' : {
'count' : 3 ,
'groups' : [
{
'type' : 'others' ,
'count' : 3 ,
'items' : [
{
'id' : '148882502' ,
'firstName' : 'James' ,
'lastName' : 'Braid' ,
'gender' : 'none' ,
'photo' : {
'prefix' : 'https://igx.4sqi.net/img/user/' ,
'suffix' : '/blank_boy.png' ,
'default' : true
}
} ,
{
'id' : '21137780' ,
'firstName' : 'Simon' ,
'lastName' : 'Gregory' ,
'gender' : 'male' ,
'photo' : {
'prefix' : 'https://igx.4sqi.net/img/user/' ,
'suffix' : '/NZ5Z5VJMRRNPKIPL.jpg'
}
}
]
}
] ,
'summary' : '3 Likes'
} ,
'dislike' : false ,
'ok' : false ,
'venueRatingBlacklisted' : true ,
'beenHere' : {
'count' : 0 ,
'unconfirmedCount' : 0 ,
'marked' : false ,
'lastCheckinExpiredAt' : 0
} ,
'specials' : {
'count' : 0 ,
'items' : [ ]
} ,
'photos' : {
'count' : 5 ,
'groups' : [
{
'type' : 'venue' ,
'name' : 'Venue photos' ,
'count' : 5 ,
'items' : [
{
'id' : '51878588498e053c231b5333' ,
'createdAt' : 1367836040 ,
'source' : {
'name' : 'Instagram' ,
'url' : 'http://instagram.com'
} ,
'prefix' : 'https://igx.4sqi.net/img/general/' ,
'suffix' : '/16198007__KficeTL_D2tiqT7Zgu3wJyiL0485yVS_uNYAtCHOxw.jpg' ,
'width' : 612 ,
'height' : 612 ,
'user' : {
'id' : '16198007' ,
'firstName' : 'houdi' ,
'gender' : 'male' ,
'photo' : {
'prefix' : 'https://igx.4sqi.net/img/user/' ,
'suffix' : '/C1OQYP3FHOP2YJYM.jpg'
}
} ,
'visibility' : 'public'
} ,
{
'id' : '5187853e498ee4fb7757a79e' ,
'createdAt' : 1367835966 ,
'source' : {
'name' : 'Instagram' ,
'url' : 'http://instagram.com'
} ,
'prefix' : 'https://igx.4sqi.net/img/general/' ,
'suffix' : '/16198007_gXoDHf06UwW-n-hUe8ul5udJut2DDZ7GocGN0Akn6IA.jpg' ,
'width' : 612 ,
'height' : 612 ,
'user' : {
'id' : '16198007' ,
'firstName' : 'houdi' ,
'gender' : 'male' ,
'photo' : {
'prefix' : 'https://igx.4sqi.net/img/user/' ,
'suffix' : '/C1OQYP3FHOP2YJYM.jpg'
}
} ,
'visibility' : 'public'
} ,
{
'id' : '4fd9da1ee4b0ea76a6c80417' ,
'createdAt' : 1339677214 ,
'source' : {
'name' : 'Foursquare for Android' ,
'url' : 'https://foursquare.com/download/#/android'
} ,
'prefix' : 'https://igx.4sqi.net/img/general/' ,
'suffix' : '/cWA5MDOAyYCEqszteU7y4Fgq3W9ngKrNaXNIF3VraEc.jpg' ,
'width' : 640 ,
'height' : 480 ,
'user' : {
'id' : '2597712' ,
'firstName' : 'Nia' ,
'lastName' : 'Wearn' ,
'gender' : 'female' ,
'photo' : {
'prefix' : 'https://igx.4sqi.net/img/user/' ,
'suffix' : '/QWON2DY3SGFP0JIN.jpg'
}
} ,
'visibility' : 'public'
} ,
{
'id' : '50ceeb05e4b01c69f47dd479' ,
'createdAt' : 1355737861 ,
'source' : {
'name' : 'Foursquare for iOS' ,
'url' : 'https://foursquare.com/download/#/iphone'
} ,
'prefix' : 'https://igx.4sqi.net/img/general/' ,
'suffix' : '/4442790_8SNrTl-wGnc9c6Ds7bHdcZeqbT9T-ScMw36KErzLDhU.jpg' ,
'width' : 537 ,
'height' : 720 ,
'user' : {
'id' : '4442790' ,
'firstName' : 'Rachel' ,
'lastName' : 'Brown' ,
'gender' : 'female' ,
'photo' : {
'prefix' : 'https://igx.4sqi.net/img/user/' ,
'suffix' : '/40RRMDM10221RS0R.jpg'
}
} ,
'visibility' : 'public'
} ,
{
'id' : '5374b0f9498e9e41f159e8fe' ,
'createdAt' : 1400156409 ,
'source' : {
'name' : 'Foursquare for iOS' ,
'url' : 'https://foursquare.com/download/#/iphone'
} ,
'prefix' : 'https://igx.4sqi.net/img/general/' ,
'suffix' : '/4353161_Rr_HCB-pEhemJxkBAmH5wWN68rju4MhbtEahLFa8trk.jpg' ,
'width' : 720 ,
'height' : 960 ,
'user' : {
'id' : '4353161' ,
'firstName' : 'sunita' ,
'lastName' : 'panich' ,
'gender' : 'none' ,
'photo' : {
'prefix' : 'https://igx.4sqi.net/img/user/' ,
'suffix' : '/I3HAQMV2YTOMNU50.jpg'
}
} ,
'visibility' : 'public'
}
]
}
]
} ,
'reasons' : {
'count' : 0 ,
'items' : [ ]
} ,
'hereNow' : {
'count' : 0 ,
'summary' : 'Nobody here' ,
'groups' : [ ]
} ,
'createdAt' : 1277377364 ,
'tips' : {
'count' : 2 ,
'groups' : [
{
'type' : 'others' ,
'name' : 'All tips' ,
'count' : 2 ,
'items' : [
{
'id' : '4d93304df7e8dcb3e594cb12' ,
'createdAt' : 1301491789 ,
'text' : 'Bring your O2 or Vodafone phone so you can actually get a signal to check in!' ,
'type' : 'user' ,
'canonicalUrl' : 'https://foursquare.com/item/4d93304df7e8dcb3e594cb12' ,
'likes' : {
'count' : 0 ,
'groups' : [ ]
} ,
'logView' : true ,
'agreeCount' : 0 ,
'disagreeCount' : 0 ,
'todo' : {
'count' : 0
} ,
'user' : {
'id' : '530470' ,
'firstName' : 'Rob' ,
'lastName' : 'Fisher' ,
'gender' : 'male' ,
'photo' : {
'prefix' : 'https://igx.4sqi.net/img/user/' ,
'suffix' : '/XAZKL04TO3CU0BCG.jpg'
}
}
} ,
{
'id' : '4d650ad689238cfa81459436' ,
'createdAt' : 1298467542 ,
'text' : 'a good exscuse for a check in!' ,
'type' : 'user' ,
'canonicalUrl' : 'https://foursquare.com/item/4d650ad689238cfa81459436' ,
'likes' : {
'count' : 0 ,
'groups' : [ ]
} ,
'logView' : true ,
'agreeCount' : 0 ,
'disagreeCount' : 0 ,
'todo' : {
'count' : 0
} ,
'user' : {
'id' : '4808723' ,
'firstName' : 'Anna' ,
'lastName' : 'Hastings' ,
'gender' : 'female' ,
'photo' : {
'prefix' : 'https://igx.4sqi.net/img/user/' ,
'suffix' : '/LM5A3CIS2TT1UHXX.jpg'
}
}
}
]
}
]
} ,
'shortUrl' : 'http://4sq.com/b9RihM' ,
'timeZone' : 'Europe/London' ,
'listed' : {
'count' : 1 ,
'groups' : [
{
'type' : 'others' ,
'name' : 'Lists from other people' ,
'count' : 1 ,
'items' : [
{
'id' : '51ffd2de498e3955660fd8b7' ,
'name' : 'Holiday' ,
'description' : '' ,
'type' : 'others' ,
'user' : {
'id' : '48298321' ,
'firstName' : 'Hans' ,
'lastName' : 'Peeters' ,
'gender' : 'male' ,
'photo' : {
'prefix' : 'https://igx.4sqi.net/img/user/' ,
'suffix' : '/OTQ3XLHGRYPQIQGR.jpg'
}
} ,
'editable' : false ,
'public' : true ,
'collaborative' : false ,
'url' : '/mstrhans/list/holiday' ,
'canonicalUrl' : 'https://foursquare.com/mstrhans/list/holiday' ,
'createdAt' : 1375720158 ,
'updatedAt' : 1377538112 ,
'followers' : {
'count' : 1
} ,
'listItems' : {
'count' : 43 ,
'items' : [
{
'id' : 'v4c233b549a67a5937ea7dd87' ,
'createdAt' : 1376225268
}
]
}
}
]
}
]
} ,
'pageUpdates' : {
'count' : 0 ,
'items' : [ ]
} ,
'inbox' : {
'count' : 0 ,
'items' : [ ]
} ,
'venueChains' : [ ] ,
'attributes' : {
'groups' : [ ]
} ,
'bestPhoto' : {
'id' : '51878588498e053c231b5333' ,
'createdAt' : 1367836040 ,
'source' : {
'name' : 'Instagram' ,
'url' : 'http://instagram.com'
} ,
'prefix' : 'https://igx.4sqi.net/img/general/' ,
'suffix' : '/16198007__KficeTL_D2tiqT7Zgu3wJyiL0485yVS_uNYAtCHOxw.jpg' ,
'width' : 612 ,
'height' : 612 ,
'visibility' : 'public'
}
} ;
2018-04-11 15:14:43 +00:00
const goodMergeResult = {
'latitude' : 56.39449115920086 ,
'longitude' : - 5.1161516920810755 ,
'name' : 'Cruachan Power Station' ,
'category' : 'Building' ,
'icon' : 'https://ss3.4sqi.net/img/categories_v2/building/default_64.png' ,
'id' : '4c233b549a67a5937ea7dd87' ,
'provider' : 'foursquare' ,
'address' : 'A85, Dalmally, PA33 1AN, United Kingdom' ,
'city' : 'Dalmally' ,
'state' : '' ,
'postcode' : 'PA33 1AN' ,
'twitter' : '' ,
'facebook' : '' ,
'url' : 'http://www.visitcruachan.co.uk' ,
'images' : [ 'https://igx.4sqi.net/img/general/640x640/16198007__KficeTL_D2tiqT7Zgu3wJyiL0485yVS_uNYAtCHOxw.jpg' ,
'https://igx.4sqi.net/img/general/640x640/16198007_gXoDHf06UwW-n-hUe8ul5udJut2DDZ7GocGN0Akn6IA.jpg' ,
'https://igx.4sqi.net/img/general/640x480/cWA5MDOAyYCEqszteU7y4Fgq3W9ngKrNaXNIF3VraEc.jpg' ,
'https://igx.4sqi.net/img/general/640x858/4442790_8SNrTl-wGnc9c6Ds7bHdcZeqbT9T-ScMw36KErzLDhU.jpg' ,
'https://igx.4sqi.net/img/general/640x853/4353161_Rr_HCB-pEhemJxkBAmH5wWN68rju4MhbtEahLFa8trk.jpg' ] ,
'tips' : [ 'Bring your O2 or Vodafone phone so you can actually get a signal to check in!' , 'a good exscuse for a check in!' ] ,
'yelp' : {
'url' : 'https://www.yelp.com/biz/cruachan-power-station-visitor-centre-dalmally?adjust_creative=s8FdwjzKWCpdbkUzShvAgg&utm_campaign=yelp_api_v3&utm_medium=api_v3_business_search&utm_source=s8FdwjzKWCpdbkUzShvAgg' ,
'rating' : 4.5 ,
'reviewCount' : 2 ,
'viewIntent' : 'https://m.yelp.com/biz/cruachan-power-station-visitor-centre-dalmally?adjust_creative=s8FdwjzKWCpdbkUzShvAgg&utm_campaign=yelp_api_v3&utm_medium=api_v3_business_search&utm_source=s8FdwjzKWCpdbkUzShvAgg'
}
} ;
2018-02-26 16:56:14 +00:00
2018-04-11 15:14:43 +00:00
const goodExplore = { 'latitude' : 56.39449115920086 , 'longitude' : - 5.1161516920810755 , 'name' : 'Cruachan Power Station' , 'category' : 'Building' , 'icon' : 'https://ss3.4sqi.net/img/categories_v2/building/default_64.png' , 'id' : '4c233b549a67a5937ea7dd87' , 'provider' : 'foursquare' , 'address' : 'A85, Dalmally, PA33 1AN, United Kingdom' , 'city' : 'Dalmally' , 'state' : '' , 'postcode' : 'PA33 1AN' , 'twitter' : '' , 'facebook' : '' , 'url' : 'http://www.visitcruachan.co.uk' } ;
2018-02-26 16:56:14 +00:00
2018-04-11 15:14:43 +00:00
const goodFS = {
2018-02-26 16:56:14 +00:00
2018-04-11 15:14:43 +00:00
'images' : [ 'https://igx.4sqi.net/img/general/640x640/16198007__KficeTL_D2tiqT7Zgu3wJyiL0485yVS_uNYAtCHOxw.jpg' ,
'https://igx.4sqi.net/img/general/640x640/16198007_gXoDHf06UwW-n-hUe8ul5udJut2DDZ7GocGN0Akn6IA.jpg' ,
'https://igx.4sqi.net/img/general/640x480/cWA5MDOAyYCEqszteU7y4Fgq3W9ngKrNaXNIF3VraEc.jpg' ,
'https://igx.4sqi.net/img/general/640x858/4442790_8SNrTl-wGnc9c6Ds7bHdcZeqbT9T-ScMw36KErzLDhU.jpg' ,
'https://igx.4sqi.net/img/general/640x853/4353161_Rr_HCB-pEhemJxkBAmH5wWN68rju4MhbtEahLFa8trk.jpg' ] ,
'tips' : [ 'Bring your O2 or Vodafone phone so you can actually get a signal to check in!' , 'a good exscuse for a check in!' ]
} ;
2018-11-11 17:47:03 +00:00
const photos = jsonfile . readFileSync ( 'test/data/photos/photo001.json' ) ;
const photosResult = { 'images' :
[ 'https://fastly.4sqi.net/img/general/640x853/1948074_vPwEHeg5do6Ee-er4kuZyduHV-vd-Q6J-65vn_ku3LQ.jpg' ,
'https://fastly.4sqi.net/img/general/640x853/436240_lf_O0Vb0OIow6QEsgzBO3I9duEs38jPXQJvv9RD9y9Q.jpg' ,
'https://fastly.4sqi.net/img/general/640x853/436240_Y5RkVVP5n24lq4ecN8ugzRgxHAQKvOlmoSJylrbn6Ps.jpg' ,
'https://fastly.4sqi.net/img/general/640x853/436240_ssnIV5giiAVgdAzC-wLu3eO7uO-aUQ2Cwxn4XYFyGXg.jpg' ,
'https://fastly.4sqi.net/img/general/640x853/436240_urUZKDPWGff2wrbkkA0nnDAwMa9lRoKXpnF9MOUfhWg.jpg' ,
'https://fastly.4sqi.net/img/general/640x853/51219901_GqEDfQTgqsYk1MM2L8BrJaw2ie7XG6slHO7VksIkyAs.jpg' ,
'https://fastly.4sqi.net/img/general/640x853/38350236_XF4cfY2mnz6EheplrEtL1Y-SCyI0aoCe-uRzIabo-dY.jpg' ,
'https://fastly.4sqi.net/img/general/640x853/21628811_olqZV44Reqhog_IGDKmYK6oAhHU0PmwctViuGPN8ZQg.jpg' ,
'https://fastly.4sqi.net/img/general/640x853/148002631_UPWDGBODb9O-HLFVAybu2lfzTCkUGablGj1RmFMSSCo.jpg' ,
'https://fastly.4sqi.net/img/general/640x480/148002631_Ck3lC-u3xNtb5uh3ObDk-_Zpkauh6EGGFZ-eD6x6Q9k.jpg' ,
'https://fastly.4sqi.net/img/general/640x480/148002631_h3I_rCAEk5-F-L_iXFTgnKK36wCWsPzXPCgGuLI6Qlo.jpg' ,
'https://fastly.4sqi.net/img/general/640x853/148002631_RN-bs3l4WpIlAHKe7imqalCRG2gWupWrGOerFQn9nTk.jpg' ] } ;
2018-04-11 15:14:43 +00:00
describe ( 'Right By Me' , ( ) => {
describe ( 'Explore' , ( ) => {
it ( 'should gracefully handle no data' , done => {
expect ( reduceExplore ( ) ) . to . eql ( { } ) ;
done ( ) ;
} ) ;
it ( 'should process data correctly' , done => {
expect ( reduceExplore ( exploreFS ) ) . to . eql ( goodExplore ) ;
done ( ) ;
} ) ;
2018-02-26 16:56:14 +00:00
} ) ;
2018-04-11 15:14:43 +00:00
describe ( 'Yelp' , ( ) => {
it ( 'should gracefully handle no data' , done => {
expect ( reduceYelp ( ) ) . to . eql ( { } ) ;
done ( ) ;
} ) ;
2018-02-26 16:56:14 +00:00
2018-04-11 15:14:43 +00:00
it ( 'should process data correctly' , done => {
expect ( reduceYelp ( YelpData ) ) . to . eql ( { 'url' : 'https://www.yelp.com/biz/cruachan-power-station-visitor-centre-dalmally?adjust_creative=s8FdwjzKWCpdbkUzShvAgg&utm_campaign=yelp_api_v3&utm_medium=api_v3_business_search&utm_source=s8FdwjzKWCpdbkUzShvAgg' , 'rating' : 4.5 , 'reviewCount' : 2 , 'viewIntent' : 'https://m.yelp.com/biz/cruachan-power-station-visitor-centre-dalmally?adjust_creative=s8FdwjzKWCpdbkUzShvAgg&utm_campaign=yelp_api_v3&utm_medium=api_v3_business_search&utm_source=s8FdwjzKWCpdbkUzShvAgg' } ) ;
done ( ) ;
} ) ;
2018-02-26 16:56:14 +00:00
2018-04-11 15:14:43 +00:00
it ( 'should handle Missing Url' , done => {
const brokenYelp = Object . assign ( { } , YelpData ) ;
delete brokenYelp . url ;
2018-02-26 16:56:14 +00:00
2018-04-11 15:14:43 +00:00
expect ( reduceYelp ( brokenYelp ) ) . to . eql ( { 'url' : '' , 'rating' : 4.5 , 'reviewCount' : 2 , 'viewIntent' : '' } ) ;
done ( ) ;
} ) ;
2018-02-26 16:56:14 +00:00
} ) ;
2018-04-11 15:14:43 +00:00
describe ( 'Full FS' , ( ) => {
it ( 'should gracefully handle no data' , done => {
expect ( reduceFullFS ( ) ) . to . eql ( { } ) ;
done ( ) ;
} ) ;
2018-02-26 16:56:14 +00:00
2018-04-11 15:14:43 +00:00
it ( 'should process data correctly' , done => {
expect ( reduceFullFS ( fullFS ) ) . to . eql ( goodFS ) ;
done ( ) ;
} ) ;
2018-02-26 16:56:14 +00:00
} ) ;
2018-11-11 17:47:03 +00:00
describe ( 'Convert photos' , ( ) => {
it ( 'should process data correctly' , done => {
expect ( reducePhotos ( photos ) ) . to . eql ( photosResult ) ;
done ( ) ;
} ) ;
} ) ;
2018-04-11 15:14:43 +00:00
describe ( 'Merging' , ( ) => {
it ( 'should gracefully handle no data' , done => {
const m = Object . assign ( reduceExplore ( ) , reduceFullFS ( ) ) ;
2018-02-26 16:56:14 +00:00
2018-04-11 15:14:43 +00:00
expect ( m ) . to . eql ( { } ) ;
done ( ) ;
} ) ;
2018-02-26 16:56:14 +00:00
2018-04-11 15:14:43 +00:00
it ( 'should Merge Cruachan correctly' , done => {
const m = Object . assign ( reduceExplore ( exploreFS ) , reduceFullFS ( fullFS ) ) ;
const yelp = reduceYelp ( YelpData ) ;
m . yelp = yelp ;
expect ( m ) . to . eql ( goodMergeResult ) ;
done ( ) ;
} ) ;
2018-02-26 16:56:14 +00:00
} ) ;
} ) ;
2018-04-11 15:14:43 +00:00