Skip to content

Conversation

@createhb21
Copy link
Member

@createhb21 createhb21 commented Nov 13, 2024

close #254

What is this PR? 🔍

msw 관련 함수들을 개선했습니다.

Changes 📋

  • 로그인을 모킹하여 여러 환경 테스트를 진행할 수 있습니다.
  • redirectUrl 조회를 모킹하여 여러 환경 테스트를 진행할 수 있습니다.
  • 앞으로 기능 개발하면서 필요해보이는 유틸 함수들을 추가했습니다.
  • README.md 수정했습니다.

@createhb21 createhb21 added the 🪛 Refactor 코드 리팩토링 label Nov 13, 2024
@createhb21 createhb21 self-assigned this Nov 13, 2024
@createhb21 createhb21 changed the title ♻️ MSW 관련 함수 리팩토링 feat: ♻️ MSW 관련 함수 리팩토링 Nov 13, 2024
});

const mock_로그인 = http.post('/auth/login', async ({ request }) => {
if (Math.random() < 0.3) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

ERROR_RATE 상수값을 사용하지 않은 이유가 혹시 있을까요?

const Posts = [];
import { authHandlers, lostFoundHandlers, userHandlers } from './units';

export const handlers = [
Copy link
Collaborator

Choose a reason for hiding this comment

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

이렇게 쓰는 패턴은 의도가 뭔가용?

Copy link
Member Author

@createhb21 createhb21 Nov 15, 2024

Choose a reason for hiding this comment

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

https://mswjs.io/docs/getting-started#step-2-describe
그냥 msw에서 제시해서 정형화된 패턴 (?)

@createhb21 createhb21 merged commit 18fe8f8 into develop Nov 16, 2024
2 checks passed
@createhb21 createhb21 deleted the feat/254 branch November 16, 2024 05:36
YoonJeongLulu added a commit that referenced this pull request Nov 19, 2024
* chore: apply dynamically config (#236)

* apply dynamically config

* fix test case

* chore: add .pnp.cjs to .gitignore (#237)

* add .pnp.cjs to .gitignore

* delete /pnp.cjs

* feat: msw 환경 구축 (#235)

* feat: msw 환경 구축

* feat: remove console

* feat: appEnvs

* feat: remove isMocking

* feat: remove v1 on handlers

* feat: remove .pnp.cjs

* feat: login callback api route (#239)

* feature middleware

* feature tokenService

* feature api routes

* fix post -> get

* update var name

* apply code review

* fix middleware

* remove unnessary codes

* apply code review

* apply code review

* feat: one-app env (#242)

* feature one-app env

* fix parsing error

* fix env

* feature site url

* feat: login pages (#241)

* feature login pages

* feature semantic naming

* remove console.log

* apply code review

* fix import error

* feat: add typescript compile check (#246)

* add typescript compile check

* add working directory

* fix: api server side routing -> client side  (#247)

* fix fix client side

* fix login structure

* make test skip

* wrap suspense to fix bugs

* fix middleware

* feat: nickname setup flow (#250)

* fix fix client side

* fix login structure

* make test skip

* wrap suspense to fix bugs

* feature nickname setup flow

* fix setToken when user has additionalInfo already

* refactor semantic namings

* refactor 훅 분리

* feature updateUser API Authorization

* remove unused components

* refactor zustand 최적화

* fix 오탈자

* fix renderIndicatorIcon naming

* apply code review

---------

Co-authored-by: Lulu <[email protected]>

* feat: one-app cd (#252)

* feature deploy web

* test deploy

* fix yml

* chore: add a comment (#253)

* add a comment

* fix route of dockerfile

* add AWS Credentials

* fix env

* fix deploy yml

* fix deploy yml

* Revert "fix deploy yml"

This reverts commit e856a97.

* Revert "fix deploy yml"

This reverts commit c501290.

* fix: typo in cicd script

* fix deploy.sh

* fix deploy yml

* fix typo

* fix typo

* fix typo

* remove unused

---------

Co-authored-by: createhb21 <[email protected]>
Co-authored-by: joohyun.ha <[email protected]>

* feat: ♻️ MSW 관련 함수 리팩토링 (#255)

---------

Co-authored-by: Hyobum Lee <[email protected]>
Co-authored-by: joohyun.ha <[email protected]>
createhb21 added a commit that referenced this pull request Jan 14, 2025
* chore: apply dynamically config (#236)

* apply dynamically config

* fix test case

* chore: add .pnp.cjs to .gitignore (#237)

* add .pnp.cjs to .gitignore

* delete /pnp.cjs

* feat: msw 환경 구축 (#235)

* feat: msw 환경 구축

* feat: remove console

* feat: appEnvs

* feat: remove isMocking

* feat: remove v1 on handlers

* feat: remove .pnp.cjs

* feat: login callback api route (#239)

* feature middleware

* feature tokenService

* feature api routes

* fix post -> get

* update var name

* apply code review

* fix middleware

* remove unnessary codes

* apply code review

* apply code review

* feat: one-app env (#242)

* feature one-app env

* fix parsing error

* fix env

* feature site url

* feat: login pages (#241)

* feature login pages

* feature semantic naming

* remove console.log

* apply code review

* fix import error

* feat: add typescript compile check (#246)

* add typescript compile check

* add working directory

* fix: api server side routing -> client side  (#247)

* fix fix client side

* fix login structure

* make test skip

* wrap suspense to fix bugs

* fix middleware

* feat: nickname setup flow (#250)

* fix fix client side

* fix login structure

* make test skip

* wrap suspense to fix bugs

* feature nickname setup flow

* fix setToken when user has additionalInfo already

* refactor semantic namings

* refactor 훅 분리

* feature updateUser API Authorization

* remove unused components

* refactor zustand 최적화

* fix 오탈자

* fix renderIndicatorIcon naming

* apply code review

---------

Co-authored-by: Lulu <[email protected]>

* feat: one-app cd (#252)

* feature deploy web

* test deploy

* fix yml

* chore: add a comment (#253)

* add a comment

* fix route of dockerfile

* add AWS Credentials

* fix env

* fix deploy yml

* fix deploy yml

* Revert "fix deploy yml"

This reverts commit e856a97.

* Revert "fix deploy yml"

This reverts commit c501290.

* fix: typo in cicd script

* fix deploy.sh

* fix deploy yml

* fix typo

* fix typo

* fix typo

* remove unused

---------

Co-authored-by: createhb21 <[email protected]>
Co-authored-by: joohyun.ha <[email protected]>

* feat: ♻️ MSW 관련 함수 리팩토링 (#255)

* feat: text & theme tailwind setting (#259)

* feature text & theme setting

* revert font

* feat: ✨ 유실물 목록 / 유실물 상세 API 연동 (#262)

* SVG To direct rendering (#263)

* feat: 유실물 페이지 비즈니스 로직들 (웹) - 리스트, 상세, 필터  (#270)

* feature business logis

* resolve conflicts

* chore: 피그마 디자인 시스템 테일윈드 테마로 적용 (#273)

* chore: 디자인 시스템에 맞게 컬러값 수정 및 신규 추가 (#269)

* chore: 폰트 사이즈 테일윈드 시스템화(fontSize 항목 확장) (#269)

* chore: green 컬러셋 추가 (#269)

* feat: 유실물 페이지 (웹) UI 스타일링 (#274)

* feature filter group setion styling

* reset filter styling

* article card styling, wip

* article detail page, wip

* article page detail styling, wip

* re-comment styling

* svgr typescript 지원

* fix build err

* chore: next.ahhachul.com 삭제 (#275)

* next.ahhachul.com 삭제

* fix codeowners

* chore: 이슈 번호 자동으로 붙도록 설정 추가 (#277) (#278)

* feat: 유실물 리스트, 상세, 댓글 목록, 댓글 입력 컴포넌트 UI 상세 작업 (#276)

* feat: 댓글 조회 api 연동

* 검색 결과 리스트가 empty 일때 보여주는 화면

* loading uis

* add empty uis

* comment text filed ui

* lost112 article 일시 상세 테이블 정보 UI가 추가된다

* article detail 내부 이미지

* img 관련 typescipt 빌드 에러 수정

* img 관련 typescipt 빌드 에러 수정 2

* img 관련 typescipt 빌드 에러 수정 3..

* refactor: isLexicalContent 유틸 함수를 early return 방식으로 변경

* chore: 절대경로 import 하는 문제 해결, eslint 관련 경고 뜨는 현상 해결 (#282)

* feat: 댓글 생성

* Absolute Path to Relative Path and Fix eslint rules errors

* chore: telemetry - false

* feat: 댓글 생성 (#283)

* resolve conficts

* feat: 유실물 글 작성 페이지 구성 (#261)

* feat: add new type definitions for LostFound data

* feat: implemented basic UI components.

* feat: add shad/cn setting file

* chore: add library

* chore: etc work

* refactor: 유실물 페이지 라우터 재구성(수정, 생성 구분)  (#258)

* feat: 이미지 업로드/삭제 기능 구현 (#258)

* chore: 지하철 호선 아이콘 추가 (#258)

* feat: 바텀 시트 구현 (#258)

* refactor: dto에 없는 지하철 호선 제거 (#258)

* feat: lexical 에디터 추가 (#258)

* chore: svg 타입 명시

* feat: 유실물 등록 기능 추가 (#258)

* chore: 아이콘 속성 올바르게 수정 (#258)

* chore: 임시로 유실물 페이지 등록 링크 추가 (#258)

* refactor: 에디터 빈 값 판단 로직 추가 (#258)

* feat: 유실물 데이터 조회 기반으로 화면에 바인딩 처리 (#258)

* chore: 유실물 데이터에 옵셔널 체이닝 적용 (#258)

* chore: 이미지 제거 아이콘 속성 수정 (#258)

* refactor: 유실물 등록/수정 로직 훅으로 분리 (#258)

* refactor: 주요 로직 훅으로 분리, 타입 정리 (#258)

* chore: eslint 파일 스타일 변경 (#258)

* refactor:  shadcn 컴포넌트 위치 이동 및 기본 설치 위치 수정 (#258)

* chore: 불필요 console.log 제거 (#258)

* chore: 디자인 시스템에 맞게 컬러값 수정 및 신규 추가 (#269)

* chore: 폰트 사이즈 테일윈드 시스템화(fontSize 항목 확장) (#269)

* chore: green 컬러셋 추가 (#269)

* refactor: LostFound 타입 명칭 수정 (#258)

* chore: 컴포넌트 스타일 수정(테일 윈드 테마 적용) (#258)

* chore: 설치 파일 동기화 (#258)

* chore: 불필요 타입 제거 (#258)

* refactor:  유실물 수정 시의 데이터 구성 로직 변경

* chore: yarn.lock 파일 업데이트 (#258)

* refactor: 중복 타입 코드 제거 (#258)

* refactor: shadcn 컴포넌트 수정(명칭 수정 및 불필요 하위 컴포넌트 제거)

* style: 불필요 css 항목 제거 (#258)

* refactor: 중복되는 스타일 유틸함수 제거 (#258)

* refactor: 기존 타입 사용하도록 적용 (#258)

* chore: 불필요 플러그인 설정에서 제거 (#258)

* style: 조건부 스타일에 대해 cn 유틸 적용 (#258)

* refactor: 유실물 등록/수정 요청 useMutation으로 적용 (#258)

* refactor: 누락된 errorFallback 추가 (#258)

* refactor: adapter 내에 lostId 없을 경우 기본 값으로 리턴되게 설정 (#258)

* refactor: 유실물 수정/생성 컴포넌트 독립적으로 생성 적용 (#258)

* chore: 타입 오류 제거

* chore: 컴포넌트 캐피털로 반영

* chore: 컴포넌트 캐피탈 다시 적용되도록 처리

* chore: 빌드 에러 수정

* uupdate deploy-app.yml

---------

Co-authored-by: Lulu <[email protected]>
Co-authored-by: joohyun.ha <[email protected]>
Co-authored-by: 이희제 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🪛 Refactor 코드 리팩토링

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[REFACTOR] MSW 관련 함수 리팩토링

4 participants