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: useDragIndexCarousel test coverage 개선 #13

Merged
merged 1 commit into from
May 22, 2024

Conversation

d0422
Copy link
Member

@d0422 d0422 commented May 22, 2024

  • useDragIndexCarousel 테스트 커버리지 개선

Before

image

After

image

Comment

jsdom 에서 pageX와 clientX를 지원하지 않는 문제가 있어 object.defineProperty를 사용하여 모킹하였습니다.

beforeAll(() => {
  Object.defineProperty(HTMLElement.prototype, 'clientWidth', {
    configurable: true,
    value: WRAPPER_WIDTH,
  });

  Object.defineProperties(MouseEvent.prototype, {
    pageX: {
      get() {
        return this.clientX;
      },
    },
  });
});

관련 이슈

@d0422 d0422 requested a review from HBSPS May 22, 2024 04:24
@d0422 d0422 self-assigned this May 22, 2024
@d0422 d0422 changed the title test: useDragIndexCarousel 테스트 커버리지 개선 test: useDragIndexCarousel test coverage 개선 May 22, 2024
Copy link
Contributor

@HBSPS HBSPS left a comment

Choose a reason for hiding this comment

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

수고하셨습니다!

@d0422 d0422 merged commit 70934c5 into Rapiders:main May 22, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants