From 39c227d4701c3cb889e9ce1b617bd9844dcd960b Mon Sep 17 00:00:00 2001 From: Abby George Date: Tue, 26 May 2020 16:49:49 -0500 Subject: [PATCH] :white_check_mark: Adding tests --- cypress/fixtures/ontologies/ontologyDetails.json | 1 + cypress/integration/ontologyDetails.js | 15 +++++++++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/cypress/fixtures/ontologies/ontologyDetails.json b/cypress/fixtures/ontologies/ontologyDetails.json index a11a511..ce38222 100644 --- a/cypress/fixtures/ontologies/ontologyDetails.json +++ b/cypress/fixtures/ontologies/ontologyDetails.json @@ -1,5 +1,6 @@ { "fullUrl": "http://hapi.fhir.org/baseR4/CodeSystem/Code1", + "valueSet": "http://hl7.org/fhir/ValueSet/Code1", "resource": { "url": "http://hl7.org/fhir/ValueSet/Code1", "resourceType": "CodeSystem", diff --git a/cypress/integration/ontologyDetails.js b/cypress/integration/ontologyDetails.js index 5b7ea61..8b3b92b 100644 --- a/cypress/integration/ontologyDetails.js +++ b/cypress/integration/ontologyDetails.js @@ -7,6 +7,12 @@ describe('Ontology Details', () => { 'https://damp-castle-44220.herokuapp.com/http://hapi.fhir.org/baseR4/StructureDefinition', response: {}, }).as('getStructureDefinition'); + cy.route({ + method: 'GET', + url: + 'https://damp-castle-44220.herokuapp.com/http://hapi.fhir.org/baseR4/StructureDefinition?valueset=http://hl7.org/fhir/ValueSet/Code1', + response: {}, + }).as('getVSStructureDefinition'); cy.route({ method: 'GET', url: @@ -27,15 +33,20 @@ describe('Ontology Details', () => { }).as('getOntology'); cy.visit('/ontologies/Code1'); - cy.wait(['@getCodeSystemStructureDefinition', '@getOntology']); + cy.wait([ + '@getCodeSystemStructureDefinition', + '@getOntology', + '@getVSStructureDefinition', + ]); }); it('loads ontology details', () => { cy.url().should('include', '/ontologies/Code1'); cy.get('a.item') .should($x => { - expect($x).to.have.length(1); + expect($x).to.have.length(2); }) .contains('Payload'); + cy.get('a.item').contains('Resources Utilizing'); }); });