Skip to content

Commit

Permalink
Merge pull request #134 from M3nin0/dev
Browse files Browse the repository at this point in the history
table: adding test for funding award components
  • Loading branch information
M3nin0 authored Dec 7, 2024
2 parents fb89be0 + b8bde78 commit 298f273
Show file tree
Hide file tree
Showing 2 changed files with 166 additions and 0 deletions.
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}
/>
);
});
});
});
109 changes: 109 additions & 0 deletions src/mocks/table/table-funding-awards.json
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"
}
}
]

0 comments on commit 298f273

Please sign in to comment.