Skip to content

Commit

Permalink
Merge pull request #281 from CovidTrackerFr/dpt-limitrophes-fix
Browse files Browse the repository at this point in the history
fix pour les départements limitrophes
  • Loading branch information
fcamblor authored Jun 30, 2022
2 parents 2dc0c21 + 74a75d7 commit 85ea263
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 28 deletions.
20 changes: 20 additions & 0 deletions src/utils/Departements.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import {DEPARTEMENTS_LIMITROPHES} from "./Departements";

describe('Departements', () => {
Object.keys(DEPARTEMENTS_LIMITROPHES).forEach(startingDep => {
DEPARTEMENTS_LIMITROPHES[startingDep].forEach(endingDep => {
it(`${startingDep} => ${endingDep} should have bijective adjacent departments`, () => {
// Given

// When
const endingDepAdjacentDepartments = DEPARTEMENTS_LIMITROPHES[endingDep];

// Then
expect(endingDepAdjacentDepartments).toBeDefined()
try {
expect(endingDepAdjacentDepartments.includes(startingDep)).toBeTrue()
}catch(e){ throw new Error(`Missing "${startingDep}" in DEPARTEMENTS_LIMITROPHES["${endingDep}"]`); }
});
})
})
});
56 changes: 28 additions & 28 deletions src/utils/Departements.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,18 @@ export const DEPARTEMENTS_LIMITROPHES: Record<CodeDepartement, CodeDepartement[]
"04": ["83","06","05","26","84","13",],
"05": ["04","26","38","73",],
"06": ["83","04",],
"07": ["48","30","84","26","38","69","43",],
"08": ["55","51","02","59",],
"07": ["48","30","84","26","38","43","42",],
"08": ["55","51","02",],
"09": ["31","11","66",],
"10": ["89","21","52","51","77",],
"11": ["09","31","81","34",],
"11": ["09","31","81","34","66",],
"12": ["34","30","48","15","46","82","81",],
"13": ["30","84","83",],
"14": ["27","61","50",],
"13": ["30","84","83","04",],
"14": ["27","61","50","76",],
"15": ["48","43","63","19","46","12",],
"16": ["17","79","86","87","24",],
"17": ["85","79","16","33",],
"18": ["36","41","45","89","58","03","23",],
"17": ["85","79","16","33","24",],
"18": ["36","41","45","58","03","23",],
"19": ["23","87","24","46","15","63",],
"2A": ["2B",],
"2B": ["2A",],
Expand All @@ -28,76 +28,76 @@ export const DEPARTEMENTS_LIMITROPHES: Record<CodeDepartement, CodeDepartement[]
"23": ["87","19","63","03","18","36",],
"24": ["17","16","87","19","46","47","33",],
"25": ["39","70","90",],
"26": ["84","04","05","38","69","07",],
"26": ["84","04","05","38","07",],
"27": ["76","60","95","78","28","61","14",],
"28": ["27","78","91","45","41","72","61",],
"29": ["22","56",],
"30": ["34","12","48","07","26","84","13",],
"30": ["34","12","48","07","84","13",],
"31": ["65","32","82","81","11","09",],
"32": ["31","65","64","40","47","82",],
"33": ["17","24","47","40",],
"34": ["11","81","12","30",],
"35": ["50","53","49","44","56","22",],
"36": ["37","41","18","23","87","86",],
"37": ["41","36","86","49","72",],
"38": ["05","73","01","69","07","26","05",],
"38": ["05","73","01","69","07","26","42",],
"39": ["01","71","21","70","25",],
"40": ["33","47","32","64",],
"41": ["72","37","36","18","45","28",],
"42": ["43","69","71","03","63",],
"43": ["48","07","69","42","63","15",],
"44": ["56","35","53","49","85",],
"42": ["43","69","71","03","63","07","38",],
"43": ["48","07","42","63","15",],
"44": ["56","35","49","85",],
"45": ["91","77","28","41","18","58","89",],
"46": ["15","19","24","47","82","12",],
"47": ["33","40","32","82","46","24",],
"48": ["12","30","07","43","15",],
"49": ["44","53","72","37","86","79","85",],
"49": ["44","53","72","37","86","79","85","35",],
"50": ["14","61","53","35",],
"51": ["02","77","10","52","55","08",],
"52": ["21","70","88","55","51","10",],
"53": ["49","72","61","50","35","44",],
"53": ["49","72","61","50","35",],
"54": ["57","67","88","55",],
"55": ["54","88","52","51","08",],
"56": ["29","22","35","44",],
"57": ["67","88","54",],
"57": ["67","54",],
"58": ["03","71","21","89","45","18",],
"59": ["02","80","62","08",],
"59": ["02","80","62",],
"60": ["02","80","76","27","95","77",],
"61": ["14","27","28","72","53","50",],
"62": ["80","59","02",],
"62": ["80","59",],
"63": ["15","43","42","03","23","19",],
"64": ["40","32","65",],
"65": ["64","32","31",],
"66": ["09","11",],
"67": ["68","88","54","57",],
"68": ["90","70","88","67",],
"69": ["01","71","42","43","07","26","38",],
"68": ["90","88","67",],
"69": ["01","71","42","38",],
"70": ["21","39","25","90","88","52",],
"71": ["03","42","69","01","39","21","58",],
"72": ["28","61","53","49","37","41",],
"73": ["74","01","38","05",],
"74": ["73","01",],
"75": ["92","93","94",],
"76": ["80","60","27",],
"77": ["89","10","51","02","60","93","91","45",],
"76": ["80","60","27","14",],
"77": ["89","10","51","02","60","93","91","45","94","95",],
"78": ["95","27","28","91","92",],
"79": ["17","85","49","86","16",],
"80": ["62","59","02","60","76",],
"81": ["11","34","12","82","31",],
"82": ["32","31","81","12","46","47",],
"83": ["13","84","04","06",],
"84": ["13","04","26","07","30",],
"84": ["13","04","26","07","30","83",],
"85": ["44","49","79","17",],
"86": ["36","37","49","79","16","87",],
"87": ["23","19","24","16","86",],
"88": ["70","90","68","67","57","54","55","52",],
"87": ["23","19","24","16","86","36",],
"88": ["70","90","68","67","54","55","52",],
"89": ["58","21","10","77","45",],
"90": ["25","70","88","68",],
"91": ["45","28","77","78","92","94",],
"92": ["75","95","78","93",],
"93": ["92","95","94","77",],
"92": ["75","95","78","93","94","91",],
"93": ["92","95","94","77","75",],
"94": ["77","75","92","93","91",],
"95": ["78","27","60","93","92",],
"95": ["78","27","60","93","92","77",],
"971": [],
"972": [],
"973": [],
Expand Down

0 comments on commit 85ea263

Please sign in to comment.