ByPlaceholderText[Testing Library]

SnowCat·2023년 3월 3일
0

Testing Library

목록 보기
3/11
post-thumbnail
getByPlaceholderText(
  container?: HTMLElement,
  text: TextMatch,
  options?: {
    exact?: boolean = true,
    normalizer?: NormalizerFn,
  }): HTMLElement
  • placerholer에 있는 텍스트를 가져오는 쿼리 메서드
<input placeholder="Username" />

on test
import {screen} from '@testing-library/dom'

const inputNode = screen.getByPlaceholderText('Username')
profile
냐아아아아아아아아앙

0개의 댓글