Skip to content

Commit

Permalink
Adjust patron menu cypress test to new reality
Browse files Browse the repository at this point in the history
  • Loading branch information
spaceo committed Jan 16, 2024
1 parent 91c2b75 commit e153017
Showing 1 changed file with 20 additions and 37 deletions.
57 changes: 20 additions & 37 deletions src/apps/menu/menu.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ describe("Menu (authenticated))", () => {
cy.getBySel("physical-loans-overdue")
.find(".number")
.should("exist")
.and("have.text", "1");
.and("have.text", "4");
cy.getBySel("physical-loans-overdue")
.find(".list-dashboard__title")
.should("exist")
Expand All @@ -284,59 +284,42 @@ describe("Menu (authenticated))", () => {
cy.getBySel("reservations-ready")
.find(".number")
.should("exist")
.and("have.text", "1");
.and("have.text", "2");
cy.getBySel("reservations-ready")
.find(".list-dashboard__title")
.should("exist")
.and("have.text", "Ready for you");

// 2.d. Menupunkterne
// 2.d.i. “Lån” viser det samlede antal lån, og linker til Udlånsoversigten. Engelsk tekst: "Loans"
cy.get(".modal-profile__links")
.find(".link-filters__tag-wrapper")
.find(".link-filters__tag")
.eq(0)
.should("exist")
.and("have.text", "Loans");
cy.get(".modal-profile__links")
.find(".link-filters__tag-wrapper")
.eq(0)
cy.getBySel("menu-navigation-item-loans")
.should("be.visible")
.and("contain", "Loans")
.find(".link-filters__counter")
.should("exist")
.and("have.text", "3");
.and("have.text", "33");

// 2.d.ii. “Reserveringer” linker til Reserveringsoversigten, og viser det samlede antal reserveringer. Engelsk: "Reservations"
cy.get(".modal-profile__links")
.find(".link-filters__tag-wrapper")
.eq(1)
.find(".link-filters__tag")
.should("exist")
.and("have.text", "Reservations");
cy.get(".modal-profile__links")
.find(".link-filters__tag-wrapper")
.eq(1)
cy.getBySel("menu-navigation-item-reservations")
.should("be.visible")
.and("contain", "Reservations")
.find(".link-filters__counter")
.should("exist")
.and("have.text", "2");
.and("have.text", "4");

// 2.d.iii. “Huskeliste” linker til Huskelisten, og viser det samlede antal materialer på huskelisten. Engelsk tekst: "My list"
cy.get(".modal-profile__links")
.find(".link-filters__tag-wrapper")
.eq(2)
.find(".link-filters__tag")
.should("exist")
.and("have.text", "My list");
cy.getBySel("menu-navigation-item-my list")
.should("be.visible")
.and("contain", "My list");

// 2.d.iv. “Gebyrer & Erstatninger” linker til Gebyrer og erstatninger, og viser det samlede antal af gebyrer og erstatninger. Engelsk: "Fees & Replacement costs"
cy.get(".modal-profile__links")
.find(".link-filters__tag-wrapper")
.eq(3)
.find(".link-filters__tag")
.should("exist")
.and("have.text", "Fees & Replacement costs");
cy.get(".modal-profile__links")
.find(".link-filters__tag-wrapper")
.eq(3)
cy.getBySel("menu-navigation-item-fees & replacement costs")
.should("be.visible")
.and("contain", "Fees & Replacement costs")
.find(".link-filters__counter")
.should("exist")
.and("have.text", "2");

// 2.e. “Log ud” knappen. Engelsk tekst: "Log out"
cy.get(".modal-profile__btn-logout")
.find("a")
Expand Down

0 comments on commit e153017

Please sign in to comment.