Skip to content
This repository was archived by the owner on Feb 10, 2025. It is now read-only.

Commit 77cf38a

Browse files
committed
TILA-1217 fix tests
1 parent 9ada5f2 commit 77cf38a

3 files changed

Lines changed: 13 additions & 2 deletions

File tree

ui/components/common/common.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,9 @@ export const HorisontalRule = styled.div`
4747
margin-top: var(--spacing-layout-m);
4848
`;
4949

50-
export const CenterSpinner = styled(LoadingSpinner)`
50+
export const CenterSpinner = styled(LoadingSpinner).attrs({
51+
"data-testid": "loading-spinner",
52+
})`
5153
margin: 0 auto var(--spacing-2-xl) auto;
5254
`;
5355

ui/cypress/integration/reservations.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import {
99
import {
1010
cancelButton,
1111
detailButton,
12+
loader,
1213
redoReservationButton,
1314
reservationCards,
1415
tab,
@@ -44,6 +45,10 @@ describe("Tilavaraus user reservations", () => {
4445
});
4546

4647
it("should list proper items with correct button states and link to reservation unit", () => {
48+
loader().should("exist");
49+
50+
loader().should("not.exist");
51+
4752
reservationCards().should("have.length", 5);
4853
timeStrip()
4954
.should("have.length", 5)
@@ -66,7 +71,7 @@ describe("Tilavaraus user reservations", () => {
6671
expect(text).to.eq("Menneet varaukset (2)");
6772
});
6873

69-
cancelButton().should("have.length", 1);
74+
cancelButton().should("have.length", 2);
7075

7176
reservationCards()
7277
.eq(0)

ui/cypress/model/reservation-list.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,7 @@ export function timeStrip(): Cypress.Chainable<JQuery<HTMLElement>> {
3131
export function ticket(): Cypress.Chainable<JQuery<HTMLElement>> {
3232
return cy.get("[data-testid='reservation__ticket--container']");
3333
}
34+
35+
export function loader(): Cypress.Chainable<JQuery<HTMLElement>> {
36+
return cy.get("[data-testid='loading-spinner']");
37+
}

0 commit comments

Comments
 (0)