Skip to content

Commit

Permalink
Update modules with security vulns, fix linting errors (#939)
Browse files Browse the repository at this point in the history
  • Loading branch information
cshnimble authored Nov 21, 2023
1 parent d40d9b5 commit 1f19d6a
Show file tree
Hide file tree
Showing 18 changed files with 3,860 additions and 12,124 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,14 @@
"cypress/no-pause": "error"
},
"env": {
"cypress/globals": true
"cypress/globals": true,
"node": true
},
"extends": [
"plugin:cypress/recommended",
"eslint:recommended"
]
],
"parserOptions": {
"ecmaVersion": 2022
}
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/// <reference types ='Cypress'/>

import BasePage from "./BasePage";
import BasePage from "./BasePage"

const currentYear = new Date();
const nextYear = new Date().setFullYear(new Date().getFullYear() + 1);
const currentYear = new Date()
const nextYear = new Date().setFullYear(new Date().getFullYear() + 1)

export default class Budget extends BasePage {
static selectors = {
Expand All @@ -26,9 +26,9 @@ export default class Budget extends BasePage {
nextFinancialYearCapitalValue: '[id="finance-projected-capital"]',
saveButton: '[class="govuk-button"]',
completeCheckbox: '[id="school-budget-information-complete"]'
};
}

static path = 'budget';
static path = 'budget'

static updateBudgetInfomation({
endOfFinanicalYear,
Expand All @@ -39,68 +39,78 @@ export default class Budget extends BasePage {
forecastedCapitalNextYear
}) {
if (!endOfFinanicalYear) {
endOfFinanicalYear = currentYear;
endOfFinanicalYear = currentYear
}

if (!endOfNextFinancialYear) {
endOfNextFinancialYear = nextYear;
endOfNextFinancialYear = nextYear
}
cy.checkPath(this.path);
cy.checkPath(this.path)

cy.get(this.selectors.changeEndOfFinancialYearLink).click()

cy.get(this.selectors.currentFinancialYearDayInput).clear().type(endOfFinanicalYear.getDate());
cy.get(this.selectors.currentFinancialYearMonthInput).clear().type(endOfFinanicalYear.getMonth() + 1); // Add 1 as months start at 0
cy.get(this.selectors.currentFinancialYearYearInput).clear().type(endOfFinanicalYear.getFullYear());
cy.get(this.selectors.currentFinancialYearRevenueInput).clear().type(forecastedRevenueCurrentYear);
cy.get(this.selectors.currentFinancialYearCapitalInput).clear().type(forecastedCapitalCurrentYear);

cy.get(this.selectors.nextFinancialYearDayInput).clear().type(endOfNextFinancialYear.getDate());
cy.get(this.selectors.nextFinancialYearMonthInput).clear().type(endOfNextFinancialYear.getMonth() + 1); // Add 1 as months start at 0
cy.get(this.selectors.nextFinancialYearYearInput).clear().type(endOfNextFinancialYear.getFullYear());
cy.get(this.selectors.nextFinancialYearRevenueInput).clear().type(forecastedRevenueNextYear);
cy.get(this.selectors.nextFinancialYearCapitalInput).clear().type(forecastedCapitalNextYear);

cy.get(this.selectors.saveButton).click();
};
cy.get(this.selectors.currentFinancialYearDayInput).clear()
cy.get(this.selectors.currentFinancialYearDayInput).type(endOfFinanicalYear.getDate())
cy.get(this.selectors.currentFinancialYearMonthInput).clear()
cy.get(this.selectors.currentFinancialYearMonthInput).type(endOfFinanicalYear.getMonth() + 1) // Add 1 as months start at 0
cy.get(this.selectors.currentFinancialYearYearInput).clear()
cy.get(this.selectors.currentFinancialYearYearInput).type(endOfFinanicalYear.getFullYear())
cy.get(this.selectors.currentFinancialYearRevenueInput).clear()
cy.get(this.selectors.currentFinancialYearRevenueInput).type(forecastedRevenueCurrentYear)
cy.get(this.selectors.currentFinancialYearCapitalInput).clear()
cy.get(this.selectors.currentFinancialYearCapitalInput).type(forecastedCapitalCurrentYear)

cy.get(this.selectors.nextFinancialYearDayInput).clear()
cy.get(this.selectors.nextFinancialYearDayInput).type(endOfNextFinancialYear.getDate())
cy.get(this.selectors.nextFinancialYearMonthInput).clear()
cy.get(this.selectors.nextFinancialYearMonthInput).type(endOfNextFinancialYear.getMonth() + 1) // Add 1 as months start at 0
cy.get(this.selectors.nextFinancialYearYearInput).clear()
cy.get(this.selectors.nextFinancialYearYearInput).type(endOfNextFinancialYear.getFullYear())
cy.get(this.selectors.nextFinancialYearRevenueInput).clear()
cy.get(this.selectors.nextFinancialYearRevenueInput).type(forecastedRevenueNextYear)
cy.get(this.selectors.nextFinancialYearCapitalInput).clear()
cy.get(this.selectors.nextFinancialYearCapitalInput).type(forecastedCapitalNextYear)

cy.get(this.selectors.saveButton).click()
}

static getCurrentFinancialYear() {
cy.checkPath(this.path);
return cy.get(this.selectors.currentFinancialYearValue);
cy.checkPath(this.path)
return cy.get(this.selectors.currentFinancialYearValue)
}

static getCurrentRevenue() {
cy.checkPath(this.path);
return cy.get(this.selectors.currentFinancialYearRevenueValue);
cy.checkPath(this.path)
return cy.get(this.selectors.currentFinancialYearRevenueValue)
}

static getCurrentCapital() {
cy.checkPath(this.path);
cy.checkPath(this.path)
return cy.get(this.selectors.currentFinancialYearCapitalValue)
}

static getNextFinancialYear() {
cy.checkPath(this.path);
return cy.get(this.selectors.nextFinancialYearValue);
cy.checkPath(this.path)
return cy.get(this.selectors.nextFinancialYearValue)
}

static getNextRevenue() {
cy.checkPath(this.path);
return cy.get(this.selectors.nextFinancialYearRevenueValue);
cy.checkPath(this.path)
return cy.get(this.selectors.nextFinancialYearRevenueValue)
}

static getNextCapital() {
cy.checkPath(this.path);
return cy.get(this.selectors.nextFinancialYearCapitalValue);
cy.checkPath(this.path)
return cy.get(this.selectors.nextFinancialYearCapitalValue)
}

static markComplete() {
cy.checkPath(this.path);
cy.get(this.selectors.completeCheckbox).check();
cy.checkPath(this.path)
cy.get(this.selectors.completeCheckbox).check()
}

static markIncomplete() {
cy.checkPath(this.path);
cy.get(this.selectors.completeCheckbox).uncheck();
cy.checkPath(this.path)
cy.get(this.selectors.completeCheckbox).uncheck()
}
};
}
Loading

0 comments on commit 1f19d6a

Please sign in to comment.