Skip to content

Commit 6b8969e

Browse files
committed
Merge branch 'master' of github.com:devinit/datahub-api
2 parents d21864f + 98ce80d commit 6b8969e

9 files changed

Lines changed: 22827 additions & 13104 deletions

File tree

src/modules/dw/CountryProfile/__snapshots__/CountryProfile.test.ts.snap

Lines changed: 11101 additions & 11712 deletions
Large diffs are not rendered by default.

src/modules/dw/Maps/__snapshots__/maps.test.ts.snap

Lines changed: 11681 additions & 1388 deletions
Large diffs are not rendered by default.

src/modules/refs/concept/__snapshots__/concept.test.ts.snap

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2900,6 +2900,8 @@ exports[`Github concept data tests should get methodology data 1`] = `
29002900
\\"uom_display\\": \\"%\\",
29012901
},
29022902
]"
2903+
<<<<<<< HEAD
2904+
=======
29032905
`;
29042906
29052907
exports[`Github concept data tests should get methodology data 2`] = `
@@ -5738,4 +5740,5 @@ exports[`Github concept data tests should get methodology data 2`] = `
57385740
},
57395741
],
57405742
}"
5743+
>>>>>>> 3c55e0d00b61103b6276ae31697335e9d2230590
57415744
`;

src/modules/refs/index.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ import {
1414
getSpotlightPageData,
1515
getUnbundlingAidPageData,
1616
getBubbleChartAnnotationPageData,
17-
getWhoAreTheGlobalP20PageData
17+
getWhoAreTheGlobalP20PageData,
18+
getProfileHeaderPageData
1819
} from './page';
1920
import {getCountries} from './global';
2021
import {getDistrictEntities} from './spotlight';
@@ -39,6 +40,7 @@ export interface IRefs {
3940
getUnbundlingAidPageData;
4041
getBubbleChartAnnotationPageData;
4142
getWhoAreTheGlobalP20PageData;
43+
getProfileHeaderPageData;
4244
}
4345

4446
const refs: IRefs = {
@@ -60,7 +62,8 @@ const refs: IRefs = {
6062
getSpotlightPageData,
6163
getUnbundlingAidPageData,
6264
getBubbleChartAnnotationPageData,
63-
getWhoAreTheGlobalP20PageData
65+
getWhoAreTheGlobalP20PageData,
66+
getProfileHeaderPageData
6467
};
6568

6669
export default [{refs: () => refs}];

src/modules/refs/page/__snapshots__/page.test.ts.snap

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,29 @@ exports[`Page data should return page data for front page 2`] = `
289289
]"
290290
`;
291291

292+
exports[`Page data should return page data for profileHeader page 1`] = `
293+
"Array [
294+
Object {
295+
\\"id\\": \\"receipt\\",
296+
\\"meta\\": \\"\\",
297+
\\"narrative\\": \\"Explore this in-depth profile to find out about poverty, population, education, health, water, sanitation and hygiene, and district public resources in {props.entity.name}.\\",
298+
\\"title\\": \\"\\",
299+
},
300+
Object {
301+
\\"id\\": \\"not-donor\\",
302+
\\"meta\\": \\"\\",
303+
\\"narrative\\": \\"Explore this in-depth profile of \${props.entity.name} to find out overall levels of poverty, income distribution, division of wealth and more. Discover how national and sub-national revenue is generated.\\",
304+
\\"title\\": \\"\\",
305+
},
306+
Object {
307+
\\"id\\": \\"donor\\",
308+
\\"meta\\": \\"\\",
309+
\\"narrative\\": \\"Explore this in-depth profile of \${props.entity.name} to see the international resources it directs to developing countries. Get an overview of government spending, population and income distribution.\\",
310+
\\"title\\": \\"\\",
311+
},
312+
]"
313+
`;
314+
292315
exports[`Page data should return page data for spotlight page 1`] = `
293316
"Array [
294317
Object {

src/modules/refs/page/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,5 @@ export const getBubbleChartAnnotationPageData = (): Promise<DH.IPage[]> =>
2121
getPageData('bubble-chart-annotation-page');
2222
export const getWhoAreTheGlobalP20PageData = (): Promise<DH.IPage[]> =>
2323
getPageData('who-are-the-global-P20-page');
24+
export const getProfileHeaderPageData = (): Promise<DH.IPage[]> =>
25+
getPageData('profile-header-page');

src/modules/refs/page/page.test.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ import {
1111
getSpotlightPageData,
1212
getUnbundlingAidPageData,
1313
getBubbleChartAnnotationPageData,
14-
getWhoAreTheGlobalP20PageData
14+
getWhoAreTheGlobalP20PageData,
15+
getProfileHeaderPageData
1516
} from '.';
1617
import * as prettyFormat from 'pretty-format';
1718

@@ -73,9 +74,14 @@ describe('Page data', () => {
7374
expect(pageData.length).toBeGreaterThan(0);
7475
expect(prettyFormat(pageData)).toMatchSnapshot();
7576
}, 10000);
76-
it('should return page data for whoAreTheGlobalP20 page', async () => {
77+
it.skip('should return page data for whoAreTheGlobalP20 page', async () => {
7778
const pageData = await getWhoAreTheGlobalP20PageData();
7879
expect(pageData.length).toBeGreaterThan(0);
7980
expect(prettyFormat(pageData)).toMatchSnapshot();
8081
}, 10000);
82+
it('should return page data for profileHeader page', async () => {
83+
const pageData = await getProfileHeaderPageData();
84+
expect(pageData.length).toBeGreaterThan(0);
85+
expect(prettyFormat(pageData)).toMatchSnapshot();
86+
}, 10000);
8187
});

src/modules/refs/page/resolver.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@ export default {
4242
},
4343
async whoAreTheGlobalP20PageData(_root, _args, ctx: IContext) {
4444
return ctx.modules.refs.getWhoAreTheGlobalP20PageData();
45+
},
46+
async profileHeaderPageData(_root, _args, ctx: IContext) {
47+
return ctx.modules.refs.getProfileHeaderPageData();
4548
}
4649
}
4750
};

src/modules/refs/page/types.gql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,5 @@ type Query {
1919
unbundlingAidPageData: [Page]
2020
bubbleChartAnnotationPageData: [Page]
2121
whoAreTheGlobalP20PageData: [Page]
22+
profileHeaderPageData: [Page]
2223
}

0 commit comments

Comments
 (0)