File size: 1,126 Bytes
f5071ca
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
/// <reference types="Cypress" />

describe('<LandingSection />', () => {
    beforeEach(() => {
        cy.visit('/')
    })

    context('<FAQComponent />', () => {
        it('leaves number of components intact even after pressing all boxes', () => {
            cy.get('.faqComponent')
                .click({ multiple: true })
                .should('have.length', 5)
        })

        it('has a set number of FAQ boxes if not clicked', () => {
            cy.get('.faqComponent')
                .should('have.length', 5)
        })

        it('opens an inner box on click', () => {
            cy.get('.tv-inner > .faqComponent')
                .first()
                .click()

            cy.get('.faqComponent')
                .should('have.length', 6)
        })
    })

    context('Sign In Button', () => {
        it("navigates to the login page on sign in button click", () => {
            cy.get('.Button')
                .contains('Sign In')
                .click()

            cy.location().should(loc => {
                expect(loc.pathname).to.eq('/login')
            })
        })
    })

})