Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 19 additions & 8 deletions cypress/e2e/OrganizationContainerMissingGridID.test.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,29 @@
describe('OrganizationContainer Display GridID if it exists', () => {
describe('Organization page GRID identifier', () => {
beforeEach(() => {
cy.setCookie('_consent', 'true')
cy.intercept('GET', '/providers', {}).as('getProviders')
})
it('visit site with gridID, id element should exist', () => {
it('shows the GRID identifier when organization has a GRID id', () => {
cy.intercept('GET', '**/api/ror/v2/organizations/052gg0110*', {
fixture: 'ror/organization-052gg0110.json',
}).as('getOrgWithGrid')
cy.visit('/ror.org/052gg0110')
cy.get('#ror-link', { timeout: 10000 })
.should('have.attr', 'href', 'https://ror.org/052gg0110')
cy
.get('.identifier').first()
.should('include.text','GRID')
.get('[data-testid="grid-identifier"]')
.should('contain.text', 'GRID')
})
it('visit site without gridID, id element not should exist', () => {
it('does not show the GRID identifier when organization has no GRID id', () => {
cy.intercept('GET', '**/api/ror/v2/organizations/02hhf2525*', {
fixture: 'ror/organization-02hhf2525.json',
}).as('getOrgWithoutGrid')
cy.visit('/ror.org/02hhf2525')
cy
.get('.identifier')
.should('not.include.text','GRID')
cy.get('#ror-link', { timeout: 10000 })
.should('have.attr', 'href', 'https://ror.org/02hhf2525')
cy.get('body')
.find('[data-testid="grid-identifier"]')
.should('not.exist')
})
})

Expand Down
22 changes: 10 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
"type-check": "tsc",
"prettier-format": "prettier --config .prettierrc.json '**/*.ts|tsx' --write",
"lint": "./node_modules/.bin/eslint . --ext .ts,.tsx",
"ci": "CYPRESS_NODE_ENV=test yarn dev & wait-on http://localhost:3000 && yarn cy:run --record --quiet",
"cy:coverage": "npx nyc report --reporter=lcov",
"cy:open": "cypress open",
"cy:run": "cypress run"
"cy:run": "cypress run",
"cy:run:record": "cypress run --record --quiet"
},
"nyc": {
"reporter": [
Expand All @@ -25,24 +25,16 @@
"dependencies": {
"@apollo/client": "^3.11.1",
"@apollo/experimental-nextjs-app-support": "^0.11.2",
"@cypress/webpack-dev-server": "^1.7.0",
"@formatjs/intl-numberformat": "^7.1.4",
"@fortawesome/fontawesome-svg-core": "^7.1.0",
"@fortawesome/free-brands-svg-icons": "^7.1.0",
"@fortawesome/free-regular-svg-icons": "^5.15.3",
"@fortawesome/free-solid-svg-icons": "^5.13.3",
"@fortawesome/react-fontawesome": "^0.2.3",
"@next/eslint-plugin-next": "16.0.10",
"@next/react-dev-overlay": "^12.0",
"@next/third-parties": "15.4.6",
"@sentry/browser": "^10.39.0",
"@sentry/node": "^5.21.4",
"@sentry/webpack-plugin": "^2.1.0",
"@tanstack/react-query": "^5.61.4",
"@testing-library/user-event": "^11.2.1",
"@types/gtag.js": "^0.0.3",
"@types/jsonwebtoken": "^8.5.0",
"@types/lodash": "^4.14.154",
"@zeit/next-source-maps": "0.0.4-canary.1",
"bootstrap": "^5.3.3",
"csv-stringify": "^6.4.0",
Expand Down Expand Up @@ -75,20 +67,26 @@
"urijs": "^1.19.11",
"vega": "^6.2.0",
"vega-embed": "^6.25.0",
"vega-lite": "^5.19.0",
"wait-on": "^9.0.3"
"vega-lite": "^5.19.0"
},
"devDependencies": {
"@cypress/browserify-preprocessor": "^3.0.0",
"@cypress/code-coverage": "^3.9.7",
"@cypress/react": "^6.1",
"@cypress/webpack-dev-server": "^1.7.0",
"@next/eslint-plugin-next": "16.0.10",
"@testing-library/react": "^10.2.1",
"@testing-library/user-event": "^11.2.1",
"@types/node": "^12.12.39",
"@types/react": "19.1.10",
"@types/react-dom": "19.1.7",
"@types/sanitize-html": "^2.11.0",
"@types/gtag.js": "^0.0.3",
"@types/jsonwebtoken": "^8.5.0",
"@types/lodash": "^4.14.154",
"@typescript-eslint/eslint-plugin": "^6.21.0",
"@typescript-eslint/parser": "^6.21.0",
"@sentry/webpack-plugin": "^2.1.0",
"concurrently": "^9.1.2",
"cypress": "^13.6.3",
"cypress-dotenv-flow": "^1.2.2",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ export default function OrganizationMetadata({
<h5 className="m-0 fw-bold">Other Identifiers</h5>
</Col></Row>
{grid.length > 0 && (
<Row className="identifier id-type-grid"><Col>
<Row className="identifier id-type-grid" data-testid="grid-identifier"><Col>
GRID{' '}{grid[0].identifier}
</Col></Row>
)}
Expand Down
Loading
Loading