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
77describe ( '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+ */
0 commit comments