Skip to content

Commit 68e9d9c

Browse files
authored
Merge branch 'main' into update-landing-909
2 parents 8103adb + cbdc2b0 commit 68e9d9c

File tree

7 files changed

+52
-29
lines changed

7 files changed

+52
-29
lines changed

.env

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
REACT_APP_API_URL=https://api.civictechindex.org
1+
REACT_APP_API_URL=https://api-stage.civictechindex.org

.env.development

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
REACT_APP_API_URL=https://api-stage.civictechindex.org

.env.production

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
REACT_APP_API_URL=https://api.civictechindex.org

cypress.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
"baseUrl": "http://localhost:3000",
33
"defaultCommandTimeout": 60000,
44
"env": {
5-
"REACT_APP_API_URL": "https://api.civictechindex.org"
5+
"REACT_APP_API_URL": "https://api-stage.civictechindex.org",
6+
"GITHUB_API_URL": "https://api.github.com"
67
},
78
"ignoreTestFiles": ["add-org.spec.js"]
89
}
Lines changed: 42 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,23 @@
1-
const SEARCH = 'organization';
2-
const Q1 = 'Can I add multiple projects';
3-
const Q2 = 'Can I change the organization my project is listed under';
4-
const A1 = 'Yes, Please follow the link to add multiple projects.';
5-
const A2 = 'Yes, you can change the organization of your project.';
1+
const SEARCH = 'civic';
2+
// const Q1 = 'Can I add multiple projects';
3+
const Q2 = 'What is Civic Tech';
4+
// const A1 = 'Yes, Please follow the link to add multiple projects.';
5+
const A2 = 'Civic technology, or civic tech, enhances the relationship between the people and government';
66

77
describe('FAQ Page (using API)', () => {
8-
it('gets faq by search', () => {
8+
before(() => {
9+
cy.intercept(`${Cypress.env('REACT_APP_API_URL')}/api/faqs/*`).as(
10+
'getFaqs'
11+
);
912
cy.visit('/about/faq');
10-
cy.get('[data-cy=search-faq]').click({ force: true }).type(SEARCH);
13+
cy.wait('@getFaqs');
14+
});
15+
16+
it('gets faq by search', () => {
1117
cy.intercept(`${Cypress.env('REACT_APP_API_URL')}/api/faqs/*`).as(
1218
'getFaqs'
1319
);
20+
cy.get('[data-cy=search-faq]').click({ force: true }).type(SEARCH);
1421
cy.wait('@getFaqs');
1522
cy.get('[data-cy=faq-question]')
1623
.first()
@@ -20,24 +27,33 @@ describe('FAQ Page (using API)', () => {
2027
});
2128
});
2229

23-
describe('FAQ Page (using fixture)', () => {
24-
before(() => {
25-
cy.intercept(`${Cypress.env('REACT_APP_API_URL')}/api/faqs/`, {
26-
fixture: 'faqs.json',
27-
});
28-
cy.visit('/about/faq');
29-
});
30+
/*
31+
* describe('FAQ Page (using fixture)', () => {
32+
* before(() => {
33+
* cy.intercept('GET', `${Cypress.env('REACT_APP_API_URL')}/api/faqs/*`, (req) => {
34+
* req.reply({
35+
* statusCode: 200,
36+
* fixture: 'faqs.json',
37+
* });
38+
* });
39+
* cy.visit('/about/faq');
40+
* });
41+
*/
3042

31-
it('title section loads', () => {
32-
cy.contains('How can we help?');
33-
});
43+
/*
44+
* it('title section loads', () => {
45+
* cy.contains('How can we help?');
46+
* });
47+
*/
3448

35-
it('default faq list is loaded', () => {
36-
cy.get('[data-cy=faq-question]').should('have.length', 10);
37-
cy.get('[data-cy=faq-question]')
38-
.first()
39-
.contains(Q1)
40-
.click({ force: true });
41-
cy.get('[data-cy=faq-answer]').first().should('contain', A1);
42-
});
43-
});
49+
/*
50+
* it('default faq list is loaded', () => {
51+
* cy.get('[data-cy=faq-question]').should('have.length', 10);
52+
* cy.get('[data-cy=faq-question]')
53+
* .first()
54+
* .contains(Q1)
55+
* .click({ force: true });
56+
* cy.get('[data-cy=faq-answer]').first().should('contain', A1);
57+
* });
58+
* });
59+
*/

cypress/integration/pages/projects.spec.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,11 @@ describe('Projects Page (Search Projects)', () => {
2020
});
2121

2222
it('loads search tips', () => {
23+
cy.intercept(`${Cypress.env('GITHUB_API_URL')}/search/repositories*`).as(
24+
'getProjects'
25+
);
2326
cy.get('[data-cy=search-projects]').click().type(SEARCH).type('{enter}');
27+
cy.wait('@getProjects');
2428
cy.get('[data-cy=how-to-improve-your-search-results]').click();
2529
cy.get('[data-cy=search-tips').within(() => {
2630
cy.get('p').first().contains('Need more search results?');

cypress/integration/pages/tag-creator.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ describe('Tag Generator Page (Tag Creator)', () => {
2424
];
2525

2626
beforeEach(() => {
27-
cy.intercept('https://api.civictechindex.org/api/organizations/').as(
27+
cy.intercept(`${Cypress.env('REACT_APP_API_URL')}/api/organizations/`).as(
2828
'getOrganizations'
2929
);
3030
cy.visit('/join-index');

0 commit comments

Comments
 (0)