-
Notifications
You must be signed in to change notification settings - Fork 131
Expand file tree
/
Copy pathowning-a-home.cy.js
More file actions
117 lines (108 loc) · 4.59 KB
/
Copy pathowning-a-home.cy.js
File metadata and controls
117 lines (108 loc) · 4.59 KB
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
import { ExploreRates } from './explore-rates-helpers.cy.js';
const exploreRates = new ExploreRates();
describe('Owning a Home', () => {
describe('Explore Rates', () => {
beforeEach(() => {
cy.visit('/owning-a-home/explore-rates/');
});
it('Should load the interest rates graph when a state has changed', () => {
exploreRates.selectState('Virginia');
exploreRates.getGraph().should('exist');
});
it('Should display high balance FHA loan when house price is high', () => {
exploreRates.getHousePriceInput().type('400000');
exploreRates.getCountySelector().should('not.be.visible');
exploreRates.getCountyAlert().should('not.be.visible');
exploreRates
.getLoanTypeSelector()
.get('[value="fha-hb"]')
.should('not.exist');
exploreRates.getHighBalanceAlert().should('not.be.visible');
exploreRates.selectLoanType('fha');
exploreRates.getCountySelector().should('be.visible');
exploreRates.getCountyAlert().should('be.visible');
exploreRates.selectCounty('Baldwin');
exploreRates.getLoanTypeSelector().get('[value="conf"]').should('exist');
exploreRates.getLoanTypeSelector().get('[value="fha"]').should('exist');
exploreRates.getLoanTypeSelector().get('[value="va"]').should('exist');
exploreRates
.getLoanTypeSelector()
.get('[value="fha-hb"]')
.should('exist');
exploreRates.getHighBalanceAlert().should('be.visible');
});
it('Should display high balance VA loan when house price is high', () => {
exploreRates.getHousePriceInput().type('600000');
exploreRates.getCountySelector().should('be.visible');
exploreRates.getCountyAlert().should('be.visible');
exploreRates
.getLoanTypeSelector()
.get('[value="va-hb"]')
.should('not.exist');
exploreRates.getHighBalanceAlert().should('not.be.visible');
exploreRates.selectLoanType('va');
exploreRates.selectCounty('Baldwin');
exploreRates.getLoanTypeSelector().get('[value="conf"]').should('exist');
exploreRates.getLoanTypeSelector().get('[value="fha"]').should('exist');
exploreRates.getLoanTypeSelector().get('[value="va"]').should('exist');
exploreRates.getLoanTypeSelector().get('[value="va-hb"]').should('exist');
exploreRates.getHighBalanceAlert().should('be.visible');
});
it('Should display conforming jumbo loan type when house price is very high', () => {
exploreRates.getHousePriceInput().type('700000');
exploreRates.getCountySelector().should('be.visible');
exploreRates.getCountyAlert().should('be.visible');
exploreRates
.getLoanTypeSelector()
.get('[value="agency"]')
.should('not.exist');
exploreRates.getHighBalanceAlert().should('not.be.visible');
exploreRates.selectCounty('Baldwin');
exploreRates
.getLoanTypeSelector()
.get('[value="agency"]')
.should('exist');
exploreRates.getHighBalanceAlert().should('be.visible');
});
it('Should display non-conforming jumbo loan type when house price is very very high', () => {
exploreRates.getHousePriceInput().type('1000000');
exploreRates.getCountySelector().should('be.visible');
exploreRates.getCountyAlert().should('be.visible');
exploreRates
.getLoanTypeSelector()
.get('[value="jumbo"]')
.should('not.exist');
exploreRates.getHighBalanceAlert().should('not.be.visible');
exploreRates.selectCounty('Baldwin');
exploreRates.getLoanTypeSelector().get('[value="jumbo"]').should('exist');
exploreRates.getHighBalanceAlert().should('be.visible');
});
it('Should display ARM type selector when rate type is adjustable', () => {
exploreRates.getChartResultAlert().should('not.be.visible');
exploreRates.getArmTypeSelector().should('not.be.visible');
exploreRates.selectRateType('Adjustable');
exploreRates.getChartResultAlert().should('be.visible');
exploreRates.getArmTypeSelector().should('be.visible');
exploreRates
.getLoanTermSelector()
.get('[value="30"]')
.should('not.be.disabled');
exploreRates
.getLoanTermSelector()
.get('[value="15"]')
.should('be.disabled');
exploreRates
.getLoanTypeSelector()
.get('[value="conf"]')
.should('not.be.disabled');
exploreRates
.getLoanTypeSelector()
.get('[value="fha"]')
.should('be.disabled');
exploreRates
.getLoanTypeSelector()
.get('[value="va"]')
.should('be.disabled');
});
});
});