Skip to content

Commit 72c534e

Browse files
committed
refactor(tests): enhance sidebar connection status tests for Google Calendar
- Updated tests to use getByRole for improved accessibility and clarity in verifying Google Calendar connection statuses. - Adjusted status messages to provide clearer context for users, ensuring accurate representation of connection states in the tests.
1 parent 09dfc7c commit 72c534e

1 file changed

Lines changed: 12 additions & 4 deletions

File tree

packages/web/src/views/Calendar/components/Sidebar/SidebarIconRow/SidebarIconRow.test.tsx

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,9 @@ describe("SidebarIconRow", () => {
7171
}),
7272
).toBeEnabled();
7373
expect(
74-
screen.getByLabelText("Google Calendar not connected"),
74+
screen.getByRole("status", {
75+
name: "Google Calendar not connected. Click to connect.",
76+
}),
7577
).toBeInTheDocument();
7678
});
7779

@@ -94,7 +96,9 @@ describe("SidebarIconRow", () => {
9496
}),
9597
).toBeEnabled();
9698
expect(
97-
screen.getByLabelText("Google Calendar needs reconnecting"),
99+
screen.getByRole("status", {
100+
name: "Google Calendar needs reconnecting. Click to reconnect.",
101+
}),
98102
).toBeInTheDocument();
99103
});
100104

@@ -117,7 +121,9 @@ describe("SidebarIconRow", () => {
117121
}),
118122
).toBeDisabled();
119123
expect(
120-
screen.getByLabelText("Google Calendar connected"),
124+
screen.getByRole("status", {
125+
name: "Google Calendar connected.",
126+
}),
121127
).toBeInTheDocument();
122128
});
123129

@@ -140,7 +146,9 @@ describe("SidebarIconRow", () => {
140146
}),
141147
).toBeDisabled();
142148
expect(
143-
screen.getByLabelText("Google Calendar syncing"),
149+
screen.getByRole("status", {
150+
name: "Google Calendar is syncing in the background.",
151+
}),
144152
).toBeInTheDocument();
145153
});
146154

0 commit comments

Comments
 (0)