Skip to content

Commit

Permalink
✅ Adding tests
Browse files Browse the repository at this point in the history
  • Loading branch information
abgeorge7 committed May 26, 2020
1 parent dd2fe09 commit 39c227d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
1 change: 1 addition & 0 deletions cypress/fixtures/ontologies/ontologyDetails.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
15 changes: 13 additions & 2 deletions cypress/integration/ontologyDetails.js
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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');
});
});

0 comments on commit 39c227d

Please sign in to comment.