-
Notifications
You must be signed in to change notification settings - Fork 0
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 #498 from IATI/develop
Develop to main for v1.9.1
- Loading branch information
Showing
12 changed files
with
633 additions
and
606 deletions.
There are no files selected for viewing
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 |
---|---|---|
|
@@ -26,7 +26,7 @@ jobs: | |
- uses: actions/checkout@v3 | ||
|
||
- name: Set up Node.js | ||
uses: actions/setup-node@v3.5.1 | ||
uses: actions/setup-node@v3.6.0 | ||
with: | ||
node-version-file: '.nvmrc' | ||
cache: 'npm' | ||
|
@@ -66,6 +66,12 @@ jobs: | |
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up Node.js | ||
uses: actions/[email protected] | ||
with: | ||
node-version-file: '.nvmrc' | ||
cache: 'npm' | ||
|
||
- name: Cypress CI Run | ||
uses: cypress-io/github-action@v5 | ||
with: | ||
|
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
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 |
---|---|---|
|
@@ -15,7 +15,7 @@ jobs: | |
- uses: actions/checkout@v3 | ||
|
||
- name: Set up Node.js | ||
uses: actions/setup-node@v3.5.1 | ||
uses: actions/setup-node@v3.6.0 | ||
with: | ||
node-version-file: ".nvmrc" | ||
cache: "npm" | ||
|
@@ -54,6 +54,12 @@ jobs: | |
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up Node.js | ||
uses: actions/[email protected] | ||
with: | ||
node-version-file: ".nvmrc" | ||
cache: "npm" | ||
|
||
- name: Cypress CI Run | ||
uses: cypress-io/github-action@v5 | ||
with: | ||
|
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
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 |
---|---|---|
@@ -1,42 +1,40 @@ | ||
/// <reference types="Cypress"/> | ||
|
||
describe("The single activity view", () => { | ||
it("Normal activity page renders with expected data", () => { | ||
cy.fixture("activity_test").then((activity_test) => { | ||
cy.intercept( | ||
"https://dev-api.iatistandard.org/dss/activity/select?wt=json&sort=iati_identifier%20asc&fl=title_narrative,title_narrative_xml_lang,description_narrative,description_narrative_xml_lang,participating_org_narrative,participating_org_narrative_xml_lang,iati_identifier,last_updated_datetime,reporting_org_ref,reporting_org_narrative,reporting_org_narrative_xml_lang,activity_date*&rows=1&q=iati_identifier:%22XM-IATI-1%22", | ||
activity_test | ||
); | ||
cy.intercept( | ||
"https://api.iatistandard.org/dss/activity/select?wt=json&sort=iati_identifier%20asc&fl=title_narrative,title_narrative_xml_lang,description_narrative,description_narrative_xml_lang,participating_org_narrative,participating_org_narrative_xml_lang,iati_identifier,last_updated_datetime,reporting_org_ref,reporting_org_narrative,reporting_org_narrative_xml_lang,activity_date*&rows=1&q=iati_identifier:%22XM-IATI-1%22", | ||
activity_test | ||
); | ||
describe('The single activity view', () => { | ||
it('Normal activity page renders with expected data', () => { | ||
cy.fixture('activity_test').then((activity_test) => { | ||
cy.intercept( | ||
'https://dev-api.iatistandard.org/dss/activity/select?wt=json&sort=iati_identifier%20asc&fl=title_narrative,title_narrative_xml_lang,description_narrative,description_narrative_xml_lang,participating_org_narrative,participating_org_narrative_xml_lang,iati_identifier,last_updated_datetime,reporting_org_ref,reporting_org_narrative,reporting_org_narrative_xml_lang,activity_date*&rows=1&q=iati_identifier:%22XM-IATI-1%22', | ||
activity_test | ||
); | ||
cy.intercept( | ||
'https://api.iatistandard.org/dss/activity/select?wt=json&sort=iati_identifier%20asc&fl=title_narrative,title_narrative_xml_lang,description_narrative,description_narrative_xml_lang,participating_org_narrative,participating_org_narrative_xml_lang,iati_identifier,last_updated_datetime,reporting_org_ref,reporting_org_narrative,reporting_org_narrative_xml_lang,activity_date*&rows=1&q=iati_identifier:%22XM-IATI-1%22', | ||
activity_test | ||
); | ||
}); | ||
cy.visit('/activity/XM-IATI-1'); | ||
cy.contains('XM-IATI-1'); | ||
cy.contains('IATI Test Activity'); | ||
cy.contains('This is an example description'); | ||
cy.contains('IATI Test Org, UK'); | ||
cy.contains('IATI Test Participating Org, UK'); | ||
}); | ||
cy.visit("/activity/XM-IATI-1"); | ||
cy.contains("XM-IATI-1"); | ||
cy.contains("IATI Test Activity"); | ||
cy.contains("This is an example description"); | ||
cy.contains("IATI Test Org, UK"); | ||
cy.contains("IATI Test Participating Org, UK"); | ||
}); | ||
|
||
it("Activity page with blank fields renders with expected data", () => { | ||
cy.fixture("activity_blank_fields_test").then( | ||
(activity_blank_fields_test) => { | ||
cy.intercept( | ||
"https://dev-api.iatistandard.org/dss/activity/select?wt=json&sort=iati_identifier%20asc&fl=title_narrative,title_narrative_xml_lang,description_narrative,description_narrative_xml_lang,participating_org_narrative,participating_org_narrative_xml_lang,iati_identifier,last_updated_datetime,reporting_org_ref,reporting_org_narrative,reporting_org_narrative_xml_lang,activity_date*&rows=1&q=iati_identifier:%22XM-IATI-2%22", | ||
activity_blank_fields_test | ||
); | ||
cy.intercept( | ||
"https://api.iatistandard.org/dss/activity/select?wt=json&sort=iati_identifier%20asc&fl=title_narrative,title_narrative_xml_lang,description_narrative,description_narrative_xml_lang,participating_org_narrative,participating_org_narrative_xml_lang,iati_identifier,last_updated_datetime,reporting_org_ref,reporting_org_narrative,reporting_org_narrative_xml_lang,activity_date*&rows=1&q=iati_identifier:%22XM-IATI-2%22", | ||
activity_blank_fields_test | ||
); | ||
} | ||
); | ||
cy.visit("/activity/XM-IATI-2"); | ||
cy.contains("Title not provided"); | ||
cy.contains("Description not provided"); | ||
cy.contains("Name not provided"); | ||
cy.contains("Participating organisations: Not provided"); | ||
}); | ||
it('Activity page with blank fields renders with expected data', () => { | ||
cy.fixture('activity_blank_fields_test').then((activity_blank_fields_test) => { | ||
cy.intercept( | ||
'https://dev-api.iatistandard.org/dss/activity/select?wt=json&sort=iati_identifier%20asc&fl=title_narrative,title_narrative_xml_lang,description_narrative,description_narrative_xml_lang,participating_org_narrative,participating_org_narrative_xml_lang,iati_identifier,last_updated_datetime,reporting_org_ref,reporting_org_narrative,reporting_org_narrative_xml_lang,activity_date*&rows=1&q=iati_identifier:%22XM-IATI-2%22', | ||
activity_blank_fields_test | ||
); | ||
cy.intercept( | ||
'https://api.iatistandard.org/dss/activity/select?wt=json&sort=iati_identifier%20asc&fl=title_narrative,title_narrative_xml_lang,description_narrative,description_narrative_xml_lang,participating_org_narrative,participating_org_narrative_xml_lang,iati_identifier,last_updated_datetime,reporting_org_ref,reporting_org_narrative,reporting_org_narrative_xml_lang,activity_date*&rows=1&q=iati_identifier:%22XM-IATI-2%22', | ||
activity_blank_fields_test | ||
); | ||
}); | ||
cy.visit('/activity/XM-IATI-2'); | ||
cy.contains('Title not provided'); | ||
cy.contains('Description not provided'); | ||
cy.contains('Name not provided'); | ||
cy.contains('Participating organisations: Not provided'); | ||
}); | ||
}); |
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
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 |
---|---|---|
@@ -1,30 +1,34 @@ | ||
/// <reference types="Cypress"/> | ||
|
||
describe("The landing view", () => { | ||
it("has a header", () => { | ||
cy.visit("/"); | ||
cy.contains("Datastore Search"); | ||
}); | ||
|
||
it("has a visible search bar", () => { | ||
cy.visit("/"); | ||
cy.get("input[title=Search]").should("be.visible"); | ||
}); | ||
describe('The landing view', () => { | ||
it('has a header', () => { | ||
cy.visit('/'); | ||
cy.contains('Datastore Search'); | ||
}); | ||
|
||
it("has a footer", () => { | ||
cy.visit("/"); | ||
cy.contains("IATI Unified Platform"); | ||
}); | ||
it('has a visible search bar', () => { | ||
cy.visit('/'); | ||
cy.get('input[title=Search]').should('be.visible'); | ||
}); | ||
|
||
describe("search bar", () => { | ||
it("routes a search to the simple view", () => { | ||
cy.get("input[title=Search]").type("test"); | ||
cy.get("button[aria-label=Submit]").click(); | ||
cy.url().should("includes", "/simple"); | ||
it('has a footer', () => { | ||
cy.visit('/'); | ||
cy.contains('IATI Unified Platform'); | ||
}); | ||
|
||
it("retains the search term after routing", () => { | ||
cy.get("input[title=Search]").should("have.value", "test"); | ||
describe('search bar', () => { | ||
it('routes a search to the simple view', () => { | ||
cy.visit('/'); | ||
cy.get('input[title=Search]').type('test'); | ||
cy.get('button[aria-label=Submit]').click(); | ||
cy.url().should('includes', '/simple'); | ||
}); | ||
|
||
it('retains the search term after routing', () => { | ||
cy.visit('/'); | ||
cy.get('input[title=Search]').type('test'); | ||
cy.get('button[aria-label=Submit]').click(); | ||
cy.get('input[title=Search]').should('have.value', 'test'); | ||
}); | ||
}); | ||
}); | ||
}); |
Oops, something went wrong.