inflearn logo
강의

강의

N
챌린지

챌린지

멘토링

멘토링

N
클립

클립

로드맵

로드맵

지식공유

윤영훈님의 게시글

윤영훈 윤영훈

@spawnnim0448

수강평 작성수
-
평균평점
-

게시글 1

질문&답변

getByrole을 통해 얻은 htmlElement 객체에 prefix에 aria

import { render, screen } from "@testing-library/react"; import OrderPage from "../OrderPage"; test("주문 확인을 위한 체크박스가 있고 타이틀은 '주문하려는 것을 확인하셨나요?' 입니다. ", () => { render( ); const checkbox = screen.getByRole("checkbox", { name: "주문하려는 것을 확인하셨나요?", }) as HTMLInputElement; expect(checkbox.checked).toEqual(false); const confirmButton = screen.getByRole("button", { name: "주문 확인", }) as HTMLButtonElement; expect(confirmButton.disabled).toBeTruthy(); }); 저는 이런식으로 작성했습니다!

좋아요수
2
댓글수
1
조회수
449