chore: migrate tests from karma to jest#8
Merged
jajugoguma merged 4 commits intomasterfrom Jun 18, 2021
Merged
Conversation
chore: remove karma-jasmine test environment
adhrinae
reviewed
Jun 18, 2021
| input.changeText(item); | ||
| expect(input.placeholderEl).toContainText('first'); | ||
|
|
||
| expect(input.placeholderEl.textContent).toContain('first'); |
There was a problem hiding this comment.
jest-dom 을 사용한다면 toHaveTextContent 단언이 있습니다.
https://github.com/testing-library/jest-dom#tohavetextcontent
Contributor
Author
There was a problem hiding this comment.
기존에 toContainText 단언을 사용하고 있어서 부분 문자열에 대한 검증을 하기 위해 toContain 단언을 사용했습니다.
확인 결과, 해당 테스트는 문자열 전체에 대해 검사를 하는 것이 맞다고 판단되어 toHaveTextContent 단언을 사용하는 것으로 변경했습니다.
|
|
||
| expect.extend({ | ||
| toBeSelected(actual) { | ||
| const result = actual.selected === true; |
There was a problem hiding this comment.
이 단언이 사용되는 테스트 케이스가 item, selectBox 두 개인데
item쪽의 테스트 케이스는 단언 자체가 private 구현에 의존하고 있어서 좀 걱정되네요.
Contributor
Author
There was a problem hiding this comment.
해당 커스텀 단언을 삭제하고 위 단언이 검증하던 속성인 'selected'의 값을 toBe 단언을 이용해 검증하는 것으로 변경했습니다.
chore: remove custom matcher 'toBeSelected'
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Please check if the PR fulfills these requirements
fix #xxx[,#xxx], where "xxx" is the issue number)Description
Thank you for your contribution to TOAST UI product. 🎉 😘 ✨