Skip to content

Commit 43b6a6e

Browse files
committed
test: assert exact mobile settings groups
1 parent 32508c7 commit 43b6a6e

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

packages/web/src/features/settings/components/settings-page.test.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -278,8 +278,12 @@ describe("SettingsPage", () => {
278278

279279
renderSettingsPage(store);
280280

281-
expect(await screen.findByText("工作区与运行")).toBeInTheDocument();
282-
expect(screen.getByText("界面与交互")).toBeInTheDocument();
281+
const mobileRoot = await screen.findByTestId("settings-mobile-root");
282+
const groupHeadings = within(mobileRoot).getAllByRole("heading", { level: 2 });
283+
284+
expect(groupHeadings).toHaveLength(2);
285+
expect(within(mobileRoot).getByText("工作区与运行")).toBeInTheDocument();
286+
expect(within(mobileRoot).getByText("界面与交互")).toBeInTheDocument();
283287
expect(document.querySelector(".settings-mobile-root-hero")).toBeNull();
284288

285289
const buttons = screen.getAllByRole("button");

0 commit comments

Comments
 (0)