-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
282 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,23 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`Utility functions test should create an aggregate sql query for a single year i.e unbundling aid 1`] = ` | ||
"Object { | ||
\\"queryA\\": \\"SELECT to_di_id, year, sum(value) AS value from fact.oda_2015 WHERE value > 0 AND year = 2015 AND sector = 'banking-and-business' GROUP BY to_di_id, year\\", | ||
\\"queryB\\": \\"SELECT bundle, year, sum(value) AS value from fact.oda_2015 WHERE value > 0 AND from_di_id = 'afdb' AND to_di_id = 'UG' AND year = 2013 GROUP BY bundle, year\\", | ||
}" | ||
`; | ||
|
||
exports[`Utility functions test should create an aggregate sql query for multiple years 1`] = `"\\"SELECT bundle, year, sum(value) AS value from fact.oda_2015 WHERE value > 0 AND from_di_id = 'afdb' AND to_di_id = 'UG' AND year >= 2013 AND year <= 2015 GROUP BY bundle, year\\""`; | ||
|
||
exports[`Utility functions test should create human friendly numbers i.e 1.5k for 1500 1`] = ` | ||
"Object { | ||
\\"formattedB\\": Array [ | ||
\\"150\\", | ||
\\"1.5k\\", | ||
\\"15k\\", | ||
\\"200m\\", | ||
exports[`Utility functions test should make tree data 1`] = ` | ||
"Array [ | ||
Array [], | ||
Array [ | ||
Object { | ||
\\"budget_type\\": \\"Actual\\", | ||
\\"color\\": \\"#5da3d9\\", | ||
\\"id\\": \\"NG\\", | ||
\\"levels\\": Array [ | ||
\\"Total Expenditure\\", | ||
\\"Spending From Excess Crude Account /Sovereign Wealth Fund\\", | ||
\\"Other Excess Crude Account\\", | ||
], | ||
\\"uid\\": \\"Total ExpenditureSpending From Excess Crude Account /Sovereign Wealth FundOther Excess Crude Account\\", | ||
\\"value\\": 539768571.48, | ||
\\"value_ncu\\": 198000000000, | ||
\\"year\\": 2006, | ||
}, | ||
], | ||
}" | ||
]" | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,185 @@ | ||
export default [{ | ||
year: 2006, | ||
budget_type: 'Actual', | ||
value: 539768571.4, | ||
value_ncu: 198000000000, | ||
uid: 'BkMRW3iFH4Tf', | ||
levels: ['Total Expenditure', | ||
'Federal Government Exoenditure', | ||
'Federal Government Extrabudgetary Funds' | ||
], | ||
color: '#5da3d9' | ||
}, | ||
{ | ||
year: 2006, | ||
budget_type: 'Actual', | ||
|
||
value: 1349421429, | ||
value_ncu: 495000000000, | ||
|
||
uid: 'BJmCbniYrN6f', | ||
levels: ['Total Expenditure', | ||
'Federal Government Exoenditure', | ||
'Federal Government Capital Expenditure' | ||
], | ||
color: '#5da3d9' | ||
}, | ||
{ | ||
year: 2006, | ||
budget_type: 'Actual', | ||
value: 528864155.9, | ||
value_ncu: 194000000000, | ||
|
||
uid: 'HyV0-2oYrNTz', | ||
levels: ['Total Expenditure', | ||
'Spending From Excess Crude Account /Sovereign Wealth Fund', | ||
'Other Excess Crude Account', | ||
'Shared Infrastructure And Social Spending' | ||
], | ||
color: '#5da3d9' | ||
}, | ||
{ | ||
year: 2006, | ||
budget_type: 'Actual', | ||
|
||
value: 6439057403, | ||
value_ncu: 2360000000000, | ||
|
||
uid: 'SJHAW2stBV6G', | ||
levels: ['Total Expenditure', 'State And Local Government'], | ||
color: '#5da3d9' | ||
}, | ||
{ | ||
year: 2006, | ||
budget_type: 'Actual', | ||
|
||
value: 2153622078, | ||
value_ncu: 790000000000, | ||
|
||
uid: 'SkLAZ2sYSV6G', | ||
levels: ['Total Expenditure', 'Other Expenditure'], | ||
color: '#e8443a' | ||
}, | ||
{ | ||
year: 2006, | ||
budget_type: 'Actual', | ||
|
||
value: 577934026, | ||
value_ncu: 212000000000, | ||
|
||
uid: 'HkPRb3jtHEpz', | ||
levels: ['Total Expenditure', 'Extrabudgetary Funds'], | ||
color: '#5da3d9' | ||
}, | ||
{ | ||
year: 2006, | ||
budget_type: 'Actual', | ||
|
||
value: 10904415.58, | ||
value_ncu: 4000000000, | ||
|
||
uid: 'HyuRZnjtHE6z', | ||
levels: ['Total Expenditure', | ||
'Spending From Excess Crude Account /Sovereign Wealth Fund', | ||
'Other Excess Crude Account', | ||
'Explicit Fuel Subsidy' | ||
], | ||
color: '#5da3d9' | ||
}, | ||
{ | ||
year: 2006, | ||
budget_type: 'Actual', | ||
|
||
value: 14260249481, | ||
value_ncu: 5230000000000, | ||
|
||
uid: 'BJF0ZnjKSEpf', | ||
levels: ['Total Expenditure'], | ||
color: '#7b3b89' | ||
}, | ||
{ | ||
year: 2006, | ||
budget_type: 'Actual', | ||
|
||
value: 607921168.8, | ||
value_ncu: 223000000000, | ||
|
||
uid: 'H19R-3oFBEaM', | ||
levels: ['Total Expenditure', | ||
'Federal Government Exoenditure', | ||
'Federal Government Recurrent Expenditure', | ||
'Overhead Cost' | ||
], | ||
color: '#5da3d9' | ||
}, | ||
{ | ||
year: 2006, | ||
budget_type: 'Actual', | ||
|
||
value: 3200445974, | ||
value_ncu: 1170000000000, | ||
|
||
uid: 'S1i0ZhjYBVpM', | ||
levels: ['Total Expenditure', | ||
'Federal Government Exoenditure', | ||
'Federal Government Recurrent Expenditure' | ||
], | ||
color: '#5da3d9' | ||
}, | ||
{ | ||
year: 2006, | ||
budget_type: 'Actual', | ||
|
||
value: 509781428.6, | ||
value_ncu: 187000000000, | ||
|
||
uid: 'H13RW3oKBV6G', | ||
levels: ['Total Expenditure', | ||
'Federal Government Exoenditure', | ||
'Federal Government Recurrent Expenditure', | ||
'Interest Payments' | ||
], | ||
color: '#5da3d9' | ||
}, | ||
{ | ||
year: 2006, | ||
budget_type: 'Actual', | ||
|
||
value: 269884285.7, | ||
value_ncu: 99000000000, | ||
|
||
uid: 'ByaAb3jFH4af', | ||
levels: ['Total Expenditure', | ||
'Federal Government Exoenditure', | ||
'Federal Government Recurrent Expenditure', | ||
'Transfers' | ||
], | ||
color: '#5da3d9' | ||
}, | ||
{ | ||
year: 2006, | ||
budget_type: 'Actual', | ||
|
||
value: 5089635974, | ||
value_ncu: 1870000000000, | ||
|
||
uid: 'SkA0-hjKHVaM', | ||
levels: ['Total Expenditure', 'Federal Government Exoenditure'], | ||
color: '#5da3d9' | ||
}, | ||
{ | ||
year: 2006, | ||
budget_type: 'Actual', | ||
|
||
value: 1812859091, | ||
value_ncu: 665000000000, | ||
|
||
uid: 'S11kMnsFS4Tz', | ||
levels: ['Total Expenditure', | ||
'Federal Government Exoenditure', | ||
'Federal Government Recurrent Expenditure', | ||
'Personnel' | ||
], | ||
color: '#5da3d9' | ||
} | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters