Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test/#84 Divider vrt 테스트 추가 #91

Merged
merged 10 commits into from
Sep 15, 2024
Merged

test/#84 Divider vrt 테스트 추가 #91

merged 10 commits into from
Sep 15, 2024

Conversation

gs0428
Copy link
Collaborator

@gs0428 gs0428 commented Sep 8, 2024

요약 (Summary)

Divider 컴포넌트의 e2e 테스트 코드를 작성했습니다.

배경 (Background)

Divider 컴포넌트의 시각적 회귀 테스트가 필요하여 playwright를 이용한 e2e 테스트 코드를 작성하게 되었습니다.

목표 (Goals)

  • Divider 컴포넌트의 e2e 테스트 코드 작성

이외 고려 사항들 (Other Considerations)

관련 이슈

Summary by CodeRabbit

  • 새로운 기능
    • "Divider" 컴포넌트에 대한 시각적 회귀 및 접근성 테스트를 추가했습니다.
    • 컴포넌트 생성 시 패키지를 선택할 수 있는 새로운 프롬프트를 추가했습니다.
  • 버그 수정
    • 시각적 변화 및 접근성 문제를 사전에 감지하여 사용자 인터페이스의 품질을 향상시켰습니다.
  • 제거된 기능
    • "Button" 컴포넌트 및 관련 테스트와 스토리를 삭제했습니다.

@gs0428 gs0428 self-assigned this Sep 8, 2024
@github-actions github-actions bot added the D-3 리뷰 마감 3일전 label Sep 8, 2024
Copy link
Contributor

coderabbitai bot commented Sep 8, 2024

Walkthrough

이 변경 사항은 Playwright를 사용하여 "Divider" 컴포넌트에 대한 엔드 투 엔드 테스트를 추가하는 새로운 파일을 도입합니다. 테스트는 시각적 회귀 테스트와 접근성 테스트로 구성되며, 각 테스트는 관련된 케이스를 그룹화하여 유지 관리성과 가독성을 향상시킵니다. 이로써 Divider 컴포넌트의 시각적 무결성과 접근성 준수를 보장합니다.

Changes

파일 경로 변경 요약
e2e/components/divider.test.ts Divider 컴포넌트에 대한 엔드 투 엔드 테스트 추가: 시각적 회귀 테스트 및 접근성 테스트 포함.
e2e/components/Button.test.ts Button 컴포넌트에 대한 테스트 파일 제거.
packages/primitive/components/Button.stories.ts Button 컴포넌트의 Storybook 스토리 파일 제거.
packages/primitive/components/Button.test.tsx Button 컴포넌트에 대한 단위 테스트 파일 제거.
packages/primitive/components/Button.tsx Button 컴포넌트 구현 파일 제거.
turbo/generators/config.ts 생성기 함수에 패키지 선택 프롬프트 추가 및 경로 업데이트.
turbo/generators/templates/e2e/test.ts.hbs 유틸리티 함수의 임포트 경로 수정.

Assessment against linked issues

Objective Addressed Explanation
Divider vrt 테스트 추가 (#84)

Possibly related PRs

Suggested labels

🔄 VRT, 🎯 기능 구현

Tip

OpenAI O1 model for chat
  • We have deployed OpenAI's latest O1 model for chat.
  • OpenAI claims that this model has superior reasoning capabilities than their GPT-4o model.
  • Please share any feedback with us in the discussions post.

Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between c2ae280 and efc902b.

Files selected for processing (3)
  • e2e/components/primitive/divider.test.ts (1 hunks)
  • turbo/generators/config.ts (1 hunks)
  • turbo/generators/templates/e2e/test.ts.hbs (1 hunks)
Files skipped from review due to trivial changes (1)
  • turbo/generators/templates/e2e/test.ts.hbs
Additional comments not posted (6)
e2e/components/primitive/divider.test.ts (4)

7-13: LGTM!

이 테스트 케이스는 horizontal divider에 대한 시각적 회귀 테스트를 정확하게 수행하고 있습니다. 테스트 구현이 PR의 목표와 잘 부합합니다.


15-21: LGTM!

이 테스트 케이스는 vertical divider에 대한 시각적 회귀 테스트를 정확하게 수행하고 있습니다. 테스트 구현이 PR의 목표와 잘 부합합니다.


23-34: 잘 작성된 접근성 테스트입니다!

axe를 사용하여 horizontal divider의 웹 접근성을 테스트하는 것은 훌륭한 아이디어입니다. 이는 컴포넌트의 접근성 준수를 보장하는 데 도움이 됩니다.


36-47: 잘 작성된 접근성 테스트입니다!

axe를 사용하여 vertical divider의 웹 접근성을 테스트하는 것은 훌륭한 아이디어입니다. 이는 컴포넌트의 접근성 준수를 보장하는 데 도움이 됩니다.

turbo/generators/config.ts (2)

73-78: 컴포넌트 생성 시 패키지 선택 프롬프트 추가

컴포넌트 생성 시 사용자가 "primitive"와 "themed" 중에서 패키지를 선택할 수 있도록 프롬프트를 추가한 것은 좋은 변경 사항입니다. 이를 통해 사용자는 생성된 컴포넌트가 어디에 위치할지에 대한 명확한 컨텍스트를 제공받을 수 있으며, 컴포넌트가 올바른 카테고리에 분류되도록 보장할 수 있습니다. 이는 전반적인 사용성을 향상시킵니다.


84-84: 생성된 테스트 파일 경로에 선택한 패키지 이름 포함

생성된 테스트 파일의 경로에 사용자가 선택한 패키지 이름을 포함하도록 변경한 것은 훌륭한 아이디어입니다. 이를 통해 출력 파일들이 사용자의 선택에 따라 해당 디렉토리에 체계적으로 구성됩니다. 이는 생성된 파일들의 구조를 개선하고 유지 관리성을 향상시킵니다.


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

github-actions bot commented Sep 8, 2024

VRT 테스트 성공

VRT 테스트가 성공적으로 완료되었습니다.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 5af121c and 43445d7.

Files selected for processing (1)
  • e2e/components/Divider.test.ts (1 hunks)
Additional comments not posted (3)
e2e/components/Divider.test.ts (3)

1-5: 적절한 라이브러리 및 유틸리티 가져오기

테스트에 필요한 Playwright 테스트 라이브러리와 접근성, 스토리북 방문 유틸리티가 적절하게 가져와졌습니다.


6-13: 수평 구분선 시각적 회귀 테스트 승인

수평 구분선에 대한 시각적 회귀 테스트가 잘 구성되어 있으며, 스크린샷을 사용하여 시각적 일관성을 확인합니다.


15-21: 수직 구분선 시각적 회귀 테스트 승인

수직 구분선에 대한 시각적 회귀 테스트도 잘 구성되어 있으며, 스크린샷을 통해 시각적 일관성을 확인합니다.

Comment on lines 23 to 39
test("axe를 사용하여 자동 접근성 테스트(horizontal)", async ({ page }: { page: Page }) => {
await visit(page, {
id: "ui-divider--horizontal",
});

const accessibilityScanResults = await axeAccessibilityScan(page);
expect(accessibilityScanResults.violations).toEqual([]);
});

test("axe를 사용하여 자동 접근성 테스트(vertical)", async ({ page }: { page: Page }) => {
await visit(page, {
id: "ui-divider--vertical",
});

const accessibilityScanResults = await axeAccessibilityScan(page);
expect(accessibilityScanResults.violations).toEqual([]);
});
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

접근성 테스트 승인 및 개선 제안

axe 도구를 사용한 수평 및 수직 구분선의 접근성 테스트가 잘 구성되어 있습니다. 접근성 검사 결과가 기대한 대로 비어 있는 배열을 반환하는지 확인합니다. 추가적으로, 접근성 검사 결과에 대한 더 상세한 검증이나 예외 처리를 고려할 수 있습니다.

접근성 검사 결과에 대한 예외 처리를 추가하여, 실패한 경우에 대한 로깅이나 추가적인 조치를 취할 수 있도록 개선하는 것을 제안합니다.

@github-actions github-actions bot added D-2 리뷰 마감 2일전 D-1 리뷰 마감 1일전 and removed D-3 리뷰 마감 3일전 D-2 리뷰 마감 2일전 labels Sep 8, 2024
@minai621 minai621 added VRT 시각적 회귀 테스트를 위해 스냅샷을 업데이트 합니다. and removed 🧪 테스트 VRT 시각적 회귀 테스트를 위해 스냅샷을 업데이트 합니다. D-1 리뷰 마감 1일전 labels Sep 10, 2024
@gs0428 gs0428 closed this Sep 10, 2024
@gs0428 gs0428 reopened this Sep 10, 2024
@github-actions github-actions bot added the D-3 리뷰 마감 3일전 label Sep 10, 2024
Copy link

VRT 테스트 성공

VRT 테스트가 성공적으로 완료되었습니다.

@minai621 minai621 added VRT 시각적 회귀 테스트를 위해 스냅샷을 업데이트 합니다. and removed VRT 시각적 회귀 테스트를 위해 스냅샷을 업데이트 합니다. labels Sep 10, 2024
Copy link
Contributor

@minai621 minai621 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

수고하셨습니다! 해당 PR에서 예시로 만들어두었던 Button 관련 파일 지우는거 어떨까요?

@gs0428
Copy link
Collaborator Author

gs0428 commented Sep 10, 2024

수고하셨습니다! 해당 PR에서 예시로 만들어두었던 Button 관련 파일 지우는거 어떨까요?

스냅샷이랑 results 폴더내에 있는 것들도 지울까요?

@minai621
Copy link
Contributor

스냅샷이랑 results 폴더내에 있는 것들도 지울까요?

다른 분들 PR 리뷰 끝나고 나면 수정하고 push 하면 될 것 같습니다!

Copy link

🐱 스토리북이 배포되었습니다: https://www.chromatic.com/build?appId=667edcfe9b923ba1892556f4&number=60 🐱

Copy link

🐱 스토리북이 배포되었습니다: https://www.chromatic.com/build?appId=667edcfe9b923ba1892556f4&number=61 🐱

Copy link

VRT 테스트 성공

VRT 테스트가 성공적으로 완료되었습니다.

Copy link

🐱 스토리북이 배포되었습니다: https://www.chromatic.com/build?appId=667edcfe9b923ba1892556f4&number=62 🐱

Copy link

VRT 테스트 성공

VRT 테스트가 성공적으로 완료되었습니다.

Copy link

🐱 스토리북이 배포되었습니다: https://www.chromatic.com/build?appId=667edcfe9b923ba1892556f4&number=63 🐱

Copy link

VRT 테스트 성공

VRT 테스트가 성공적으로 완료되었습니다.

Copy link

🐱 스토리북이 배포되었습니다: https://www.chromatic.com/build?appId=667edcfe9b923ba1892556f4&number=64 🐱

Copy link

VRT 테스트 성공

VRT 테스트가 성공적으로 완료되었습니다.

ghdtjgus76 and others added 2 commits September 13, 2024 22:22
* chore: 크로마틱 배포 시 pnpm 캐시 사용하도록 변경

* chore: VRT 스냅샷 업데이트 시 pnpm, playwright 캐시 사용하도록 변경

* chore: PR VRT 테스트 시 pnpm, playwright 캐시 사용하도록 변경

* chore: chromatic_auto_deploy 코드 리뷰 반영

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* chore: 코드 리뷰 반영

* chore: ${action} 캐시 형식으로 각 step name 변경

* chore: 각 action 최신 버전을 사용하도록 버전 수정

* chore: 의존성 설치 관련 스크립트 분리 후 재사용

* chore: playwright 설치 관련 스크립트 분리 후 재사용

* chore: 잘못된 경로 설정 수정

* chore: 잘못된 경로 설정 수정

* chore: pnpm, node 버전 환경 변수로 불러오도록 설정

* chore: 환경 변수 설정 별도 스크립트로 분리

* chore: pnpm/action-setup v4 버전으로 변경

* chore: eol 이슈 해결

* chore: 워크플로우 name 변경

---------

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
* feat: e2e 테스트 코드 템플릿 파일 생성

* feat: e2e 테스트 코드 템플릿 파일 생성기 config 작성

* chore: e2e 테스트 파일 생성기 파일명 kebabCase로 수정

* chore: 예시 버튼 e2e 테스트 파일 삭제

* chore: 스토리북 템플릿 id ui로 시작되도록 수정
Copy link

🐱 스토리북이 배포되었습니다: https://www.chromatic.com/build?appId=667edcfe9b923ba1892556f4&number=65 🐱

Copy link

VRT 테스트 성공

VRT 테스트가 성공적으로 완료되었습니다.

Copy link

VRT 테스트 성공

VRT 테스트가 성공적으로 완료되었습니다.

Copy link

🐱 스토리북이 배포되었습니다: https://www.chromatic.com/build?appId=667edcfe9b923ba1892556f4&number=66 🐱

Copy link
Collaborator

@ghdtjgus76 ghdtjgus76 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

머지 ㄱ

@gs0428 gs0428 merged commit b96c727 into develop Sep 15, 2024
3 of 4 checks passed
@gs0428 gs0428 deleted the test/#84 branch September 15, 2024 08:16
gs0428 added a commit that referenced this pull request Sep 30, 2024
* test: Divider 컴포넌트의 e2e 테스트 코드 작성

* chore: Button 관련 파일들 모두 삭제

* rename: 컴포넌트명 케밥케이스로 변경

* chore: 테스트 파일 내부 텍스트 변경

* chore: 캐시된 내용 삭제

* rename: e2e 테스트 폴더 구조 변경

* feat/#50 github action 워크플로우 최적화 (#90)

* chore: 크로마틱 배포 시 pnpm 캐시 사용하도록 변경

* chore: VRT 스냅샷 업데이트 시 pnpm, playwright 캐시 사용하도록 변경

* chore: PR VRT 테스트 시 pnpm, playwright 캐시 사용하도록 변경

* chore: chromatic_auto_deploy 코드 리뷰 반영

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* chore: 코드 리뷰 반영

* chore: ${action} 캐시 형식으로 각 step name 변경

* chore: 각 action 최신 버전을 사용하도록 버전 수정

* chore: 의존성 설치 관련 스크립트 분리 후 재사용

* chore: playwright 설치 관련 스크립트 분리 후 재사용

* chore: 잘못된 경로 설정 수정

* chore: 잘못된 경로 설정 수정

* chore: pnpm, node 버전 환경 변수로 불러오도록 설정

* chore: 환경 변수 설정 별도 스크립트로 분리

* chore: pnpm/action-setup v4 버전으로 변경

* chore: eol 이슈 해결

* chore: 워크플로우 name 변경

---------

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* feat/#85 codegen에 e2e 테스트 코드 템플릿 생성 및 적용 (#92)

* feat: e2e 테스트 코드 템플릿 파일 생성

* feat: e2e 테스트 코드 템플릿 파일 생성기 config 작성

* chore: e2e 테스트 파일 생성기 파일명 kebabCase로 수정

* chore: 예시 버튼 e2e 테스트 파일 삭제

* chore: 스토리북 템플릿 id ui로 시작되도록 수정

* fix: e2e 테스트 plob 템플릿 수정

---------

Co-authored-by: 홍서현 <[email protected]>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
gs0428 added a commit that referenced this pull request Sep 30, 2024
* feat: hr 태그 style 초기화하는 로직 생성

* docs: Horizontal일 떄 args 추가

* test/#84 Divider vrt 테스트 추가 (#91)

* test: Divider 컴포넌트의 e2e 테스트 코드 작성

* chore: Button 관련 파일들 모두 삭제

* rename: 컴포넌트명 케밥케이스로 변경

* chore: 테스트 파일 내부 텍스트 변경

* chore: 캐시된 내용 삭제

* rename: e2e 테스트 폴더 구조 변경

* feat/#50 github action 워크플로우 최적화 (#90)

* chore: 크로마틱 배포 시 pnpm 캐시 사용하도록 변경

* chore: VRT 스냅샷 업데이트 시 pnpm, playwright 캐시 사용하도록 변경

* chore: PR VRT 테스트 시 pnpm, playwright 캐시 사용하도록 변경

* chore: chromatic_auto_deploy 코드 리뷰 반영

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* chore: 코드 리뷰 반영

* chore: ${action} 캐시 형식으로 각 step name 변경

* chore: 각 action 최신 버전을 사용하도록 버전 수정

* chore: 의존성 설치 관련 스크립트 분리 후 재사용

* chore: playwright 설치 관련 스크립트 분리 후 재사용

* chore: 잘못된 경로 설정 수정

* chore: 잘못된 경로 설정 수정

* chore: pnpm, node 버전 환경 변수로 불러오도록 설정

* chore: 환경 변수 설정 별도 스크립트로 분리

* chore: pnpm/action-setup v4 버전으로 변경

* chore: eol 이슈 해결

* chore: 워크플로우 name 변경

---------

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* feat/#85 codegen에 e2e 테스트 코드 템플릿 생성 및 적용 (#92)

* feat: e2e 테스트 코드 템플릿 파일 생성

* feat: e2e 테스트 코드 템플릿 파일 생성기 config 작성

* chore: e2e 테스트 파일 생성기 파일명 kebabCase로 수정

* chore: 예시 버튼 e2e 테스트 파일 삭제

* chore: 스토리북 템플릿 id ui로 시작되도록 수정

* fix: e2e 테스트 plob 템플릿 수정

---------

Co-authored-by: 홍서현 <[email protected]>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* chore/#93 husky 오류 해결 (#112)

* fix: pre-commit 오류 일으키는 코드 제거

* fix: jest testMatch 수정

* refactor: husky 구버전 관련 코드 pre push에서 제거

---------

Co-authored-by: 홍서현 <[email protected]>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: ShinYoung-Kim <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
D-0 리뷰 마감 당일(꼭 리뷰해주세요!) VRT 시각적 회귀 테스트를 위해 스냅샷을 업데이트 합니다.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Divider vrt 테스트 추가
4 participants