Skip to content

Commit

Permalink
Upgrade to cypress@6.8.0 (Fixes #180)
Browse files Browse the repository at this point in the history
  • Loading branch information
scottohara committed Mar 30, 2021
1 parent eb9de96 commit c8251f1
Show file tree
Hide file tree
Showing 24 changed files with 112 additions and 111 deletions.
10 changes: 5 additions & 5 deletions cypress/integration/accounts/index.spec.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import {
Account,
AccountType
} from "../../support/accounts/types";
} from "accounts/types";
import {
accountDeleteForm,
accountDeleteHeading
} from "../../support/accounts/delete";
} from "accounts/delete";
import {
accountEditForm,
accountEditHeading
} from "../../support/accounts/edit";
} from "accounts/edit";
import {
accountName,
accountType,
Expand All @@ -27,11 +27,11 @@ import {
negativeBalanceTableRows,
negativeTableTotals,
negativeTotal
} from "../../support/accounts/index";
} from "accounts/index";
import {
transactionsIndexHeading,
transactionsTable
} from "../../support/transactions";
} from "transactions";

describe("Account Index", (): void => {
let expected: { accountTypes: AccountType[]; total: string; },
Expand Down
10 changes: 5 additions & 5 deletions cypress/integration/authentication/edit.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
loginForm,
notLoggedInMessage,
populateFormWith
} from "../../support/authentication/edit";
} from "authentication/edit";

describe("Authentication Edit", (): void => {
beforeEach((): void => {
Expand All @@ -18,9 +18,9 @@ describe("Authentication Edit", (): void => {
it("should login if the credentials are valid", (): void => {
populateFormWith(Cypress.env("LOOT_USERNAME"), Cypress.env("LOOT_PASSWORD"));
cy.get(loginButton).click();
cy.contains(errorMessage).should("not.be.visible");
cy.contains(notLoggedInMessage).should("not.be.visible");
cy.get(loginForm).should("not.be.visible");
cy.contains(errorMessage).should("not.exist");
cy.contains(notLoggedInMessage).should("not.exist");
cy.get(loginForm).should("not.exist");
});

it("should not login if the credentials are invalid", (): void => {
Expand All @@ -33,6 +33,6 @@ describe("Authentication Edit", (): void => {
it("should not login when the cancel button is clicked", (): void => {
cy.get(cancelButton).click();
cy.contains(notLoggedInMessage).should("be.visible");
cy.get(loginForm).should("not.be.visible");
cy.get(loginForm).should("not.exist");
});
});
12 changes: 6 additions & 6 deletions cypress/integration/categories/delete.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
deleteButton,
getDirectionLabel,
warningMessage
} from "../../support/categories/delete";
} from "categories/delete";
import {
categoriesTableRows,
checkRowMatches,
Expand All @@ -20,8 +20,8 @@ import {
lastSubcategory,
secondLastSubcategory,
secondSubcategory
} from "../../support/categories/index";
import { Category } from "../../support/categories/types";
} from "categories/index";
import { Category } from "categories/types";

describe("Category Delete", (): void => {
let originalRowCount: number;
Expand All @@ -39,7 +39,7 @@ describe("Category Delete", (): void => {
});

it("should display the details of the category being deleted", (): void => {
cy.contains(warningMessage).should(`${hasChildren ? "" : "not."}be.visible`);
cy.contains(warningMessage).should(hasChildren ? "be.visible" : "not.exist");
cy.get(categoryToDeleteName).should("have.text", categoryToDelete.name);
if (isSubcategory) {
cy.get(categoryToDeleteParent).should("have.text", categoryToDelete.parent);
Expand All @@ -49,7 +49,7 @@ describe("Category Delete", (): void => {

it("should not save changes when the cancel button is clicked", (): void => {
cy.get(cancelButton).click();
cy.get(categoryDeleteForm).should("not.be.visible");
cy.get(categoryDeleteForm).should("not.exist");

// Row count should not have changed
cy.get(categoriesTableRows).should("have.length", originalRowCount);
Expand All @@ -60,7 +60,7 @@ describe("Category Delete", (): void => {

it("should delete an existing category when the delete button is clicked", (): void => {
cy.get(deleteButton).click();
cy.get(categoryDeleteForm).should("not.be.visible");
cy.get(categoryDeleteForm).should("not.exist");

// Row count should have decremented by one + the number of children
cy.get(categoriesTableRows).should("have.length", originalRowCount - (hasChildren ? 3 : 1));
Expand Down
24 changes: 12 additions & 12 deletions cypress/integration/categories/edit.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
getValuesFrom,
lastParentCategory,
lastSubcategory
} from "../../support/categories/index";
} from "categories/index";
import {
cancelButton,
categoryEditForm,
Expand All @@ -17,8 +17,8 @@ import {
invalidateForm,
populateFormWith,
saveButton
} from "../../support/categories/edit";
import { Category } from "../../support/categories/types";
} from "categories/edit";
import { Category } from "categories/types";

describe("Category Edit", (): void => {
let expected: Category,
Expand All @@ -27,7 +27,7 @@ describe("Category Edit", (): void => {
function commonBehaviour(targetRow: string): void {
it("should not save changes when the cancel button is clicked", (): void => {
cy.get(cancelButton).click();
cy.get(categoryEditForm).should("not.be.visible");
cy.get(categoryEditForm).should("not.exist");

// Row count should not have changed
cy.get(categoriesTableRows).should("have.length", originalRowCount);
Expand Down Expand Up @@ -78,7 +78,7 @@ describe("Category Edit", (): void => {

it("should insert a new category when the save button is clicked", (): void => {
cy.get(saveButton).click();
cy.get(categoryEditForm).should("not.be.visible");
cy.get(categoryEditForm).should("not.exist");

// Row count should have incremented by one
cy.get(categoriesTableRows).should("have.length", originalRowCount + 1);
Expand All @@ -98,7 +98,7 @@ describe("Category Edit", (): void => {

it("should insert a new category when the save button is clicked", (): void => {
cy.get(saveButton).click();
cy.get(categoryEditForm).should("not.be.visible");
cy.get(categoryEditForm).should("not.exist");

// Row count should have incremented by one
cy.get(categoriesTableRows).should("have.length", originalRowCount + 1);
Expand All @@ -122,7 +122,7 @@ describe("Category Edit", (): void => {

it("should insert a new category when the save button is clicked", (): void => {
cy.get(saveButton).click();
cy.get(categoryEditForm).should("not.be.visible");
cy.get(categoryEditForm).should("not.exist");

// Row count should have incremented by one
cy.get(categoriesTableRows).should("have.length", originalRowCount + 1);
Expand All @@ -144,7 +144,7 @@ describe("Category Edit", (): void => {

it("should insert a new category when the save button is clicked", (): void => {
cy.get(saveButton).click();
cy.get(categoryEditForm).should("not.be.visible");
cy.get(categoryEditForm).should("not.exist");

// Row count should have incremented by one
cy.get(categoriesTableRows).should("have.length", originalRowCount + 1);
Expand Down Expand Up @@ -178,7 +178,7 @@ describe("Category Edit", (): void => {

it("should update an existing category when the save button is clicked", (): void => {
cy.get(saveButton).click();
cy.get(categoryEditForm).should("not.be.visible");
cy.get(categoryEditForm).should("not.exist");

// Row count should not have changed
cy.get(categoriesTableRows).should("have.length", originalRowCount);
Expand All @@ -199,7 +199,7 @@ describe("Category Edit", (): void => {

it("should update an existing category when the save button is clicked", (): void => {
cy.get(saveButton).click();
cy.get(categoryEditForm).should("not.be.visible");
cy.get(categoryEditForm).should("not.exist");

// Row count should not have changed
cy.get(categoriesTableRows).should("have.length", originalRowCount);
Expand All @@ -224,7 +224,7 @@ describe("Category Edit", (): void => {

it("should update an existing category when the save button is clicked", (): void => {
cy.get(saveButton).click();
cy.get(categoryEditForm).should("not.be.visible");
cy.get(categoryEditForm).should("not.exist");

// Row count should not have changed
cy.get(categoriesTableRows).should("have.length", originalRowCount);
Expand All @@ -247,7 +247,7 @@ describe("Category Edit", (): void => {

it("should update an existing category when the save button is clicked", (): void => {
cy.get(saveButton).click();
cy.get(categoryEditForm).should("not.be.visible");
cy.get(categoryEditForm).should("not.exist");

// Row count should not have changed
cy.get(categoriesTableRows).should("have.length", originalRowCount);
Expand Down
12 changes: 6 additions & 6 deletions cypress/integration/categories/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,21 @@ import {
checkRowMatches,
editButton,
favouriteButton
} from "../../support/categories/index";
} from "categories/index";
import {
categoryDeleteForm,
categoryDeleteHeading
} from "../../support/categories/delete";
} from "categories/delete";
import {
categoryEditForm,
categoryEditHeading
} from "../../support/categories/edit";
} from "categories/edit";
import {
transactionsIndexHeading,
transactionsTable
} from "../../support/transactions";
import { Category } from "../../support/categories/types";
import { testNavigableTable } from "../../support/og-components/og-table-navigable";
} from "transactions";
import { Category } from "categories/types";
import { testNavigableTable } from "og-components/og-table-navigable";

describe("Category Index", (): void => {
let expected: Category[];
Expand Down
10 changes: 5 additions & 5 deletions cypress/integration/payees/delete.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ import {
payeeDeleteForm,
payeeDeleteHeading,
payeeToDelete
} from "../../support/payees/delete";
} from "payees/delete";
import {
checkRowMatches,
getValuesFrom,
payeesTableRows
} from "../../support/payees/index";
import { Payee } from "../../support/payees/types";
} from "payees/index";
import { Payee } from "payees/types";

describe("Payee Delete", (): void => {
let originalRowCount: number,
Expand Down Expand Up @@ -40,7 +40,7 @@ describe("Payee Delete", (): void => {

it("should not save changes when the cancel button is clicked", (): void => {
cy.get(cancelButton).click();
cy.get(payeeDeleteForm).should("not.be.visible");
cy.get(payeeDeleteForm).should("not.exist");

// Row count should not have changed
cy.get(payeesTableRows).should("have.length", originalRowCount);
Expand All @@ -51,7 +51,7 @@ describe("Payee Delete", (): void => {

it("should delete an existing payee when the delete button is clicked", (): void => {
cy.get(deleteButton).click();
cy.get(payeeDeleteForm).should("not.be.visible");
cy.get(payeeDeleteForm).should("not.exist");

// Row count should have decremented by one
cy.get(payeesTableRows).should("have.length", originalRowCount - 1);
Expand Down
12 changes: 6 additions & 6 deletions cypress/integration/payees/edit.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ import {
payeeEditHeading,
populateFormWith,
saveButton
} from "../../support/payees/edit";
} from "payees/edit";
import {
checkRowMatches,
getValuesFrom,
payeesTableRows
} from "../../support/payees/index";
import { Payee } from "../../support/payees/types";
} from "payees/index";
import { Payee } from "payees/types";

describe("Payee Edit", (): void => {
let expected: Payee,
Expand All @@ -23,7 +23,7 @@ describe("Payee Edit", (): void => {
function commonBehaviour(): void {
it("should not save changes when the cancel button is clicked", (): void => {
cy.get(cancelButton).click();
cy.get(payeeEditForm).should("not.be.visible");
cy.get(payeeEditForm).should("not.exist");

// Row count should not have changed
cy.get(payeesTableRows).should("have.length", originalRowCount);
Expand Down Expand Up @@ -71,7 +71,7 @@ describe("Payee Edit", (): void => {

it("should insert a new payee when the save button is clicked", (): void => {
cy.get(saveButton).click();
cy.get(payeeEditForm).should("not.be.visible");
cy.get(payeeEditForm).should("not.exist");

// Row count should have incremented by one
cy.get(payeesTableRows).should("have.length", originalRowCount + 1);
Expand All @@ -95,7 +95,7 @@ describe("Payee Edit", (): void => {

it("should update an existing payee when the save button is clicked", (): void => {
cy.get(saveButton).click();
cy.get(payeeEditForm).should("not.be.visible");
cy.get(payeeEditForm).should("not.exist");

// Row count should not have changed
cy.get(payeesTableRows).should("have.length", originalRowCount);
Expand Down
12 changes: 6 additions & 6 deletions cypress/integration/payees/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,21 @@ import {
editButton,
favouriteButton,
payeesTableRows
} from "../../support/payees/index";
} from "payees/index";
import {
payeeDeleteForm,
payeeDeleteHeading
} from "../../support/payees/delete";
} from "payees/delete";
import {
payeeEditForm,
payeeEditHeading
} from "../../support/payees/edit";
} from "payees/edit";
import {
transactionsIndexHeading,
transactionsTable
} from "../../support/transactions/index";
import { Payee } from "../../support/payees/types";
import { testNavigableTable } from "../../support/og-components/og-table-navigable";
} from "transactions/index";
import { Payee } from "payees/types";
import { testNavigableTable } from "og-components/og-table-navigable";

describe("Payee Index", (): void => {
let expected: Payee[];
Expand Down
10 changes: 5 additions & 5 deletions cypress/integration/schedules/edit.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {
Schedule,
ScheduleEdit
} from "../../support/schedules/types";
} from "schedules/types";
import {
addDays,
lightFormat,
Expand All @@ -14,15 +14,15 @@ import {
saveButton,
scheduleEditForm,
scheduleEditHeading
} from "../../support/schedules/edit";
} from "schedules/edit";
import {
checkRowMatches,
checkSubtransactionRowValues,
getValuesFrom,
scheduleSubtransactionsTableRows,
scheduleSubtransactionsToggleButton,
schedulesTableRows
} from "../../support/schedules/index";
} from "schedules/index";

describe("Schedule Edit", (): void => {
let expected: ScheduleEdit,
Expand All @@ -32,7 +32,7 @@ describe("Schedule Edit", (): void => {
function commonBehaviour(): void {
it("should not save changes when the cancel button is clicked", (): void => {
cy.get(cancelButton).click();
cy.get(scheduleEditForm).should("not.be.visible");
cy.get(scheduleEditForm).should("not.exist");

// Row count should not have changed
cy.get(schedulesTableRows).should("have.length", originalRowCount);
Expand Down Expand Up @@ -341,7 +341,7 @@ describe("Schedule Edit", (): void => {

it("should insert a new schedule when the save button is clicked", (): void => {
cy.get(saveButton).click();
cy.get(scheduleEditForm).should("not.be.visible");
cy.get(scheduleEditForm).should("not.exist");

// Row count should have incremented by one
cy.get(schedulesTableRows).should("have.length", originalRowCount + 1);
Expand Down

0 comments on commit c8251f1

Please sign in to comment.