From 2df5d6d23bc86758dd8814e6565218161590fbc4 Mon Sep 17 00:00:00 2001 From: Stephen Hess Date: Tue, 19 Sep 2017 15:33:56 -0400 Subject: [PATCH] add empire to coarse reverse controller --- controller/coarse_reverse.js | 1 + test/unit/controller/coarse_reverse.js | 41 ++++++++++++++++---------- 2 files changed, 27 insertions(+), 15 deletions(-) diff --git a/controller/coarse_reverse.js b/controller/coarse_reverse.js index ce3ad52a..3f8129a3 100644 --- a/controller/coarse_reverse.js +++ b/controller/coarse_reverse.js @@ -16,6 +16,7 @@ const coarse_granularities = [ 'macroregion', 'dependency', 'country', + 'empire', 'continent', 'ocean', 'marinearea' diff --git a/test/unit/controller/coarse_reverse.js b/test/unit/controller/coarse_reverse.js index 403e5875..df231075 100644 --- a/test/unit/controller/coarse_reverse.js +++ b/test/unit/controller/coarse_reverse.js @@ -211,17 +211,21 @@ module.exports.tests.success_conditions = (test, common) => { { id: 100, name: 'country name', abbr: 'xyz'}, { id: 101, name: 'country name 2'} ], + empire: [ + { id: 110, name: 'empire name', abbr: 'empire abbr'}, + { id: 111, name: 'empire name 2'} + ], continent: [ - { id: 110, name: 'continent name', abbr: 'continent abbr'}, - { id: 111, name: 'continent name 2'} + { id: 120, name: 'continent name', abbr: 'continent abbr'}, + { id: 121, name: 'continent name 2'} ], ocean: [ - { id: 120, name: 'ocean name', abbr: 'ocean abbr'}, - { id: 121, name: 'ocean name 2'} + { id: 130, name: 'ocean name', abbr: 'ocean abbr'}, + { id: 131, name: 'ocean name 2'} ], marinearea: [ - { id: 130, name: 'marinearea name', abbr: 'marinearea abbr'}, - { id: 131, name: 'marinearea name 2'} + { id: 140, name: 'marinearea name', abbr: 'marinearea abbr'}, + { id: 141, name: 'marinearea name 2'} ] }; @@ -295,14 +299,17 @@ module.exports.tests.success_conditions = (test, common) => { country: ['country name'], country_id: ['100'], country_a: ['xyz'], + empire: ['empire name'], + empire_id: ['110'], + empire_a: ['empire abbr'], continent: ['continent name'], - continent_id: ['110'], + continent_id: ['120'], continent_a: ['continent abbr'], ocean: ['ocean name'], - ocean_id: ['120'], + ocean_id: ['130'], ocean_a: ['ocean abbr'], marinearea: ['marinearea name'], - marinearea_id: ['130'], + marinearea_id: ['140'], marinearea_a: ['marinearea abbr'], }, center_point: { @@ -844,17 +851,21 @@ module.exports.tests.failure_conditions = (test, common) => { { id: 100, name: 'country name', abbr: 'xyz'}, { id: 101, name: 'country name 2'} ], + empire: [ + { id: 110, name: 'empire name', abbr: 'empire abbr'}, + { id: 111, name: 'empire name 2'} + ], continent: [ - { id: 110, name: 'continent name', abbr: 'continent abbr'}, - { id: 111, name: 'continent name 2'} + { id: 120, name: 'continent name', abbr: 'continent abbr'}, + { id: 121, name: 'continent name 2'} ], ocean: [ - { id: 120, name: 'ocean name', abbr: 'ocean abbr'}, - { id: 121, name: 'ocean name 2'} + { id: 130, name: 'ocean name', abbr: 'ocean abbr'}, + { id: 131, name: 'ocean name 2'} ], marinearea: [ - { id: 130, name: 'marinearea name', abbr: 'marinearea abbr'}, - { id: 131, name: 'marinearea name 2'} + { id: 140, name: 'marinearea name', abbr: 'marinearea abbr'}, + { id: 141, name: 'marinearea name 2'} ] };