Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
8618311
Add rate-explorer tests
anselmbradford Mar 29, 2023
32e9f7b
Merge branch 'main' into ans_oah_tests
anselmbradford May 5, 2023
de5c8e8
Merge branch 'main' into ans_oah_tests
anselmbradford Nov 8, 2023
7704018
Merge branch 'main' into ans_oah_tests
anselmbradford Dec 19, 2023
b3e0257
Merge branch 'main' into ans_oah_tests
anselmbradford Dec 20, 2023
1326188
Merge branch 'main' into ans_oah_tests
anselmbradford Jan 26, 2024
93746e1
Merge branch 'main' into ans_oah_tests
anselmbradford Feb 13, 2024
e951bef
Merge branch 'main' into ans_oah_tests
anselmbradford Mar 13, 2024
972fe00
Merge branch 'main' into ans_oah_tests
anselmbradford Mar 29, 2024
0128ca9
Merge branch 'main' into ans_oah_tests
anselmbradford Apr 11, 2024
58158cc
Merge branch 'main' into ans_oah_tests
anselmbradford Apr 26, 2024
21dbd92
Merge branch 'main' into ans_oah_tests
anselmbradford Apr 26, 2024
9eb323e
Merge branch 'main' into ans_oah_tests
anselmbradford May 2, 2024
907d1e3
Merge branch 'main' into ans_oah_tests
anselmbradford Jul 30, 2024
a742e34
Merge branch 'main' into ans_oah_tests
anselmbradford Oct 23, 2024
1e7fbbc
Merge branch 'main' into ans_oah_tests
anselmbradford Nov 14, 2024
c0b31a8
Merge branch 'main' into ans_oah_tests
anselmbradford Apr 1, 2025
d6fa1be
Merge branch 'main' into ans_oah_tests
anselmbradford Apr 25, 2025
0aaf53d
Merge branch 'main' into ans_oah_tests
anselmbradford Jul 9, 2025
9ab569f
Merge branch 'main' into ans_oah_tests
anselmbradford Aug 19, 2025
a95507c
Merge branch 'main' into ans_oah_tests
anselmbradford Aug 26, 2025
8c0f26e
Merge branch 'main' into ans_oah_tests
anselmbradford Jan 13, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,13 +1,59 @@
export class ExploreRates {
open() {
cy.visit('/owning-a-home/explore-rates/');
}

selectState(state) {
cy.get('#location').select(state);
}

graph() {
selectRateType(val) {
this.getRateTypeSelector().select(val);
}

selectLoanType(val) {
this.getLoanTypeSelector().select(val);
}

selectCounty(val) {
this.getCountySelector().select(val);
}

getHousePriceInput() {
return cy.get('#house-price');
}

getCountySelector() {
return cy.get('#county');
}

getCountyAlert() {
return cy.get('#county-warning');
}

getHighBalanceAlert() {
return cy.get('#hb-warning');
}

// Loan type and term drop-down menus.
getRateTypeSelector() {
return cy.get('#rate-structure');
}

getLoanTermSelector() {
return cy.get('#loan-term');
}

getLoanTypeSelector() {
return cy.get('#loan-type');
}

getArmTypeSelector() {
return cy.get('#arm-type');
}

// Main graph area.
getGraph() {
return cy.get('#chart-section').within(() => cy.get('figure:first'));
}

getChartResultAlert() {
return cy.get('#chart-result-alert');
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,114 @@ 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.open();
exploreRates.selectState('Virginia');
exploreRates.graph().should('exist');
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');
});
});
});
Loading