-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #134 from M3nin0/dev
table: adding test for funding award components
- Loading branch information
Showing
2 changed files
with
166 additions
and
0 deletions.
There are no files selected for viewing
57 changes: 57 additions & 0 deletions
57
src/lib/components/table/thematic/FundingAwardsTable/FundingAwardsTable.test.js
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,57 @@ | ||
/* | ||
* This file is part of GEO-Components-React. | ||
* Copyright (C) 2022 GEO Secretariat. | ||
* | ||
* GEO-Components-React is free software; you can redistribute it and/or modify it | ||
* under the terms of the MIT License; see LICENSE file for more details. | ||
*/ | ||
|
||
import React from 'react'; | ||
|
||
import { FundingAwardsTable } from './FundingAwardsTable'; | ||
|
||
import { render } from '../../../../../setupTestRenders'; | ||
|
||
import fundingAwardsTable from '../../../../../mocks/table/table-funding-awards.json'; | ||
|
||
const extraConfiguration = { | ||
'eu-funding-logos': [ | ||
{ | ||
id: 'eu-fundedby-2014-2020', | ||
text: 'Funded by the European Union', | ||
logo: 'eu-fundedby-2014-2020.png', | ||
programme: '2014 - 2020', | ||
}, | ||
{ | ||
id: 'eu-fundedby-2021-2027', | ||
text: 'Funded by the European Union', | ||
logo: 'eu-fundedby-2021-2027.png', | ||
programme: '2021 - 2027', | ||
}, | ||
{ | ||
id: 'eu-cofundedby-2021-2027', | ||
text: 'Co-funded by the European Union', | ||
logo: 'eu-cofundedby-2021-2027.png', | ||
programme: '2021-2027', | ||
}, | ||
{ | ||
id: 'eu-ng-fundedby-2021-2027', | ||
text: 'Funded by the European Union (NextGenerationEU)', | ||
logo: 'eu-ng-fundedby-2021-2027.png', | ||
programme: '2021 - 2027', | ||
}, | ||
], | ||
}; | ||
|
||
describe('FundingAwardsTable tests', () => { | ||
describe('Render tests', () => { | ||
it('should render with the required props without crashing', () => { | ||
render( | ||
<FundingAwardsTable | ||
tableData={fundingAwardsTable} | ||
extraConfig={extraConfiguration} | ||
/> | ||
); | ||
}); | ||
}); | ||
}); |
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,109 @@ | ||
[ | ||
{ | ||
"award": { | ||
"disclaimer": "Sample text", | ||
"icon": "eu-fundedby-2014-2020", | ||
"id": "00k4n6c32::293973", | ||
"identifiers": [ | ||
{ | ||
"identifier": "https://cordis.europa.eu/projects/293973", | ||
"scheme": "url" | ||
} | ||
], | ||
"number": "293973", | ||
"title": { | ||
"en": "Unraveling the therapeutic potential of cancer-associated fibroblasts (CAF) in cancer using cell-specific targeting technology" | ||
} | ||
}, | ||
"funder": { | ||
"id": "00k4n6c32", | ||
"name": "European Commission" | ||
} | ||
}, | ||
{ | ||
"award": { | ||
"disclaimer": "Sample text", | ||
"icon": "eu-ng-fundedby-2021-2027", | ||
"id": "00k4n6c32::223791", | ||
"identifiers": [ | ||
{ | ||
"identifier": "https://cordis.europa.eu/projects/223791", | ||
"scheme": "url" | ||
} | ||
], | ||
"number": "223791", | ||
"title": { | ||
"en": "Towards a common e-Science infrastrcucture for the European and Asian Grids" | ||
} | ||
}, | ||
"funder": { | ||
"id": "00k4n6c32", | ||
"name": "European Commission" | ||
} | ||
}, | ||
{ | ||
"award": { | ||
"id": "01cwqze88::5R01AI073204-02", | ||
"number": "5R01AI073204-02", | ||
"title": { | ||
"en": "In vivo regulation of M. tuberculosis cell wall lipids" | ||
} | ||
}, | ||
"funder": { | ||
"id": "01cwqze88", | ||
"name": "National Institutes of Health" | ||
} | ||
}, | ||
{ | ||
"award": { | ||
"identifiers": [ | ||
{ | ||
"identifier": "https://google.com", | ||
"scheme": "url" | ||
} | ||
], | ||
"number": "454745", | ||
"title": { | ||
"en": "A randomised trial of surgery versus surgery plus radiotherapy for regional control in patients with stage 3 melanoma" | ||
} | ||
}, | ||
"funder": { | ||
"id": "03n51vw80", | ||
"name": "Croatian Science Foundation" | ||
} | ||
}, | ||
{ | ||
"award": { | ||
"id": "01cwqze88::5T23MH018955-03", | ||
"number": "5T23MH018955-03", | ||
"title": { | ||
"en": "HUMAN RESOURCE DEVELOPMENT DEMO PROJECT NURSE ED. PROG." | ||
} | ||
}, | ||
"funder": { | ||
"id": "01cwqze88", | ||
"name": "National Institutes of Health" | ||
} | ||
}, | ||
{ | ||
"award": { | ||
"disclaimer": "Sample text", | ||
"icon": "eu-cofundedby-2021-2027", | ||
"id": "00k4n6c32::618105", | ||
"identifiers": [ | ||
{ | ||
"identifier": "https://cordis.europa.eu/projects/618105", | ||
"scheme": "url" | ||
} | ||
], | ||
"number": "618105", | ||
"title": { | ||
"en": "Food security, Agriculture, Climate Change ERA-NET plus" | ||
} | ||
}, | ||
"funder": { | ||
"id": "00k4n6c32", | ||
"name": "European Commission" | ||
} | ||
} | ||
] |