-
Notifications
You must be signed in to change notification settings - Fork 155
[2단계 - 상세 정보 & UI/UX 개선하기] 먼지 미션 제출합니다. #316
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
Open
stardusty-lab
wants to merge
104
commits into
woowacourse:stardusty-lab
Choose a base branch
from
stardusty-lab:step2
base: stardusty-lab
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
104 commits
Select commit
Hold shift + click to select a range
ab98b35
docs: 영화 목록 불러오기 미션 요구사항 정리
boboyoii eb0458c
chore: 초기 렌더링 화면 세팅
boboyoii 3ea0f8b
feat: 페이지 번호에 따라 영상 목록을 불러오는 기능 추가
boboyoii 00ff192
feat: 불러온 영화 목록을 화면에 렌더링 하는 기능 추가
boboyoii 2bff17a
reafctor: api 함수 분리
boboyoii 07fd962
refactor: 영화 목록 렌더링 기능 함수 분리
boboyoii 534ade5
feat: 페이지 상단에 평점이 가장 높은 영화 출력 기능 추가
boboyoii 32e6536
feat: 더보기 버튼 클릭 시 영화 목록이 추가되는 기능 추가
boboyoii d0d406c
feat: 영화 목록 끝에 도달한 경우에 더보기 버튼 숨김 기능 추가
boboyoii 2911dbc
feat: 영화 검색 기능 추가
boboyoii 181716b
feat: 검색 결과가 없을 때 안내메시지 출력 기능 추가
boboyoii 1a4964c
feat: 영화 목록이 렌더링 되기 전에 스켈레턴을 렌더링하는 기능 추가
boboyoii 6a16aa5
test: 영화 목록 조회 기능 테스트
boboyoii 895e47a
test: 영화 검색 기능 테스트 추가
boboyoii 99c3f0e
fix: 검색 더보기 버튼에서 인기 api 호출 되는 문제 수정
boboyoii 9877f63
refactor: 렌더링하는 함수 파일로 분리 및 검색 기능의 공통 함수 분리
boboyoii 29f0b85
refactor: 렌더 함수 컴포넌트 별로 파일 분리
boboyoii 1c62e42
refactor: 페이지 상태값 클래스로 관리
boboyoii fcf82b3
feat: 검색어가 입력되지 않을 경우 검색 기능이 수행되지 않도록 하는 기능
boboyoii 3c5b5a3
feat: api 반환 값이 200이 아닐 경우 에러 메시지를 띄우는 기능 추가
boboyoii 4aa9426
style: 검색창과 검색 입력시 결과 없음 스타일 적용
boboyoii 5815f2c
chore: 에러메시지 수정
boboyoii f190475
test: api 테스트 목업데이터 구조 수정
boboyoii 982c938
chore: 이미지, style 경로 수정
boboyoii fb1b181
fix: poster_path 가 비어 있는 경우 Fallback img 대신 사용
79f0277
fix: 서버에서 준 인기 영화 리스트 데이터를 매핑 처리
ecf9cc0
fix: getTopRatedMovie, getSearchMovie 에도 매핑 처리 추가
e3a2c5c
refactor: fromMovieDto의 매개변수 타입을 unknown 으로 처리
9be31cd
refactor: isObject 로 객체여부 검증 함수 처리
4092629
refactor: isObject 리턴 타입에 타입가드 적용
7ded50b
refactor: 중복되는 영화 목록 파싱 로직을 parseMovies 함수로 분리
45dbcfa
refactor: mapper 함수 별도 파일로 분리
3ddfbc8
refactor: isObject 함수를 utils/type-guards/ 로 따로 뺌
2bed519
fix: 상단 평점 영화 이미지 의 필드가 nullable 한 경우 처리
783436e
fix: 서버에서 넘겨준 backdrop_path 타입등에 문제가 있을떄 api 단에서 처리
b987d9e
fix: 상단 배너 데이터 없을떄 빈 배열인 경우 처리 용으로 render 함수에 movie 데이터만 넘김
0dd994b
refactor: 평점 데이터 없는 경우 ui 처리 안함을 render 함수 내부로 옮김
509c2f3
fix: 이미지 및 css 파일 경로 / 절대 경로로 맞추기
a67f5de
fix: 상단 배너 보여줄때 remove 에서 처리한 부분 복원
d56b460
fix: skeleton 의 animation 처리를 요청시 바로 시작하기
7b4b761
fix: skeleton 최소 노출 시간 줄이기
41b58b5
fix: 최소유지 시간 과 제거시간 구분처리
b70bf05
refactor: remaining값 재처리로 중복 코드 제거
c30ba97
fix: skeleton ui로인하여 클릭 등 안되던 문제 해결
7a173e7
fix: 검색 버튼 클릭시 검색 요청이 실제로 발생하지 않았는지 체크
4ea83d1
fix: 요구사항 정책에 맞추지 않고 이전 개수 대비 증가 체크
f7dbde5
fix: api 함수 응답값 실패 처리를 공통 형식으로 맞추기
5cf6dc9
fix: 서버응답이 있는 에러에 대한 ui 처리 추가
ee4b76f
fix: fetch 함수 공통화
0add2d3
refactor: 공통 api 호출함수에 method, query 받아서 처리하도록 변경
7b919eb
fix: encodeURICompoenent 를 사용해서 query의 value값 직렬화
e39ed1f
fix: URLSearchParams를 이용해서 query 처리
c39956b
fix: query (query string) 를 fetch 공통 함수에 넘겨서 처리
33b42d5
fix: 검색어가 주소창에 남아 있는 경우 검색어 ui로 처리
383f6bf
fix: initload로 처음 로드 데이터 분기 처리 함수 따로 빼기
824e4fc
docs: step2의 요구사항 문서화
7556c98
feat: 모달 안의 내 평점 ui 디자인 구현
480c41e
feat: modal html 을 index.html 에 template 으로 넣기
6f9fb27
feat: modal html 을 index.html 에 template 으로 넣기
adc8774
feat: modal template 내 dom에 id 달기 for data binding
2f1843d
test: 상세 영화 데이터 fixtures 추가
e147eb9
test: 상세 영화 정보 팝업 관련 테스트
5255031
feat: 상세 movie api 응답값용 dto 추가
9f6deef
feat: 상세 영화 api 용 함수 추가
01f13a9
feat: 영화 리스트를 클릭시 상세 영화 팝업 여는 handler 연결
585d5af
feat: 영화 상세 팝업 data binding 처리
ddbf63a
feat: 상세 팝업 창 닫기 처리 - 닫기 버튼 클릭시, esc 입력시
5171a10
test: 더보기 버튼 클릭으로 영화 목록 추가 렌더링 테스트를 무한 스크롤 이벤트 테스트로 변경
f6c94bc
refactor: 더보기 버튼 클릭 이벤트 핸들러 함수로 추출
3df3693
feat: 스크롤을 끝까지 했을때 영화 목록 더 불러오기
c443bbc
refactor: handleMoverDetail 함수 위치를 main.ts 파일 내에서 변경 - for 그룹핑
0c5497a
test: 검색 테스트에서 더보기 버튼 클릭 이벤트 테스트를 스크롤 테스트로 변경
56ce513
test: 테스트 코드 오류 수정 - 스크롤을 끝까지 내리고 나서 더 영화 목록이 추가되지 않음을 확인
5c917bb
feat: 서버로부터 받은 데이터 중 총 페이지 수 상태 관리 추가
2f66cc2
feat: 서버로부터 받은 영화목록 값(인기, 검색) 중 총 페이수 저장
9b358b8
feat: 저장된 총 페이지 수와 현재 페이지 수 비교후 같으면 api 요청 및 렌더링 하지 않기
d614acb
refactor: 스크롤을 다 내렸는지 검사하는 로직을 함수로 추출
28c70fb
feat: 반응형 디자인 구현
39ee4bc
fix: 모달 반응형 디자인의 break-point 조정
15ae7f4
test: 평점 영화 테스트 추가
8d0b144
feat: 내 별점의 별에 클릭 이벤트 바인딩 처리
e1200c0
feat: localStorage에 평가한 별점 저장
d97cd11
feat: 매긴 별점을 렌더링해서 보여준다
dfcd9c6
fix: 별점에 따른 별 표시 on 처리를 remove 하는 경우도 포함
aea2ed7
feat: 상세 영화 모달 오픈시 매겼던 영화 평점 보여주기
c8dbfa8
fix: 매겼던 영화 평점이 안보이는 오류 수정
0c155c1
fix: 별점 저장 localStorage key 값 오타 수정
f053897
refactor: 매긴 별점 렌더링 하는 함수에게 별점 넘겨서 처리
5dfd957
feat: 매긴 평점 숫자및 의미 노출
dd015be
test: 별점 선택 별 index 오류 수정
4487d6d
test: 별점 렌더링 확인 및 별점 재 설정 테스트시 이전 별점 체크 상황 만들기
041cc2b
fix: localStorage 가 비었을때 오류 처리 수정
b9dbf54
refator: 별점 저장 및 얻기 기능 repository로 추출
135efbd
refactor: 별점 저장소의 interface 만들고 상속 받음
a15be7a
refactor: 공통 fetch 함수 분리
601cc76
refactor: fetch 공통함수 고도화
2fc6da2
feat: 더보기 버튼 삭제 및 이벤트 삭제
53c7210
fix: 새로고침시 page1과 page2 요청이 둘다 바로 일어나는 버그 수정 - isFetching 변수 도입
a47ac4c
Merge branch 'step2-fetch' into step2
2ab5dde
Merge branch 'stardusty-lab' into step2
9e055cf
feat: errorMessages 상수변수 사용, 메시지 보여주는 처리 함수 사용 미반영분 추가 처리
0eb6e9e
Merge branch 'step2' into step2-infiniate-scroll
60c32f4
feat: isFetching 변수 감싸서 처리
9e41d07
fix: isFetching 변수를 api 호출 성공 여부와 관계 없이 초기화
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,115 @@ | ||
| import { moviesFixture, movieFixture } from "../../test/fixtures"; | ||
|
|
||
| const mathRound = (value: number, numDigits:number = 1): number => { | ||
| return Math.round(value * 10 ** numDigits) / 10 ** numDigits; | ||
| } | ||
|
|
||
| describe("영화 상세 팝업 기능 테스트", () => { | ||
| beforeEach(() => { | ||
| cy.intercept("GET", "**/movie/popular?page=1", { | ||
| statusCode: 200, | ||
| body: { | ||
| page: 1, | ||
| results: [...moviesFixture], | ||
| total_pages: 2, | ||
| total_results: 40, | ||
| }, | ||
| }).as("getPopularPage1"); | ||
|
|
||
| cy.intercept("GET", `**/movie/${movieFixture.id}`, { | ||
| statusCode: 200, | ||
| body: { ...movieFixture }, | ||
| }).as("getMovieId"); | ||
|
|
||
| cy.visit("localhost:5173"); | ||
| cy.wait("@getPopularPage1"); | ||
| }); | ||
|
|
||
| it("제목을 누르면 상세 팝업이 렌더링 된다.", () => { | ||
| cy.get("#movie-list li").first().find(".thumbnail").click(); | ||
|
|
||
| cy.wait("@getMovieId"); | ||
|
|
||
| cy.get("#modalBackground").should('have.length', 1); | ||
| cy.get("#detail-modal-title").should('have.text', movieFixture.title); | ||
| cy.get("#detail-modal-img").should('have.attr', 'src').and('include', movieFixture.poster_path); | ||
| cy.get("#detail-modal-rate").should('have.text', mathRound(movieFixture.vote_average)); | ||
| cy.get("#detail-modal-detail").should('have.text', movieFixture.overview); | ||
| }); | ||
|
|
||
| it("닫기버튼을 누르면 상세 팝업이 닫힌다.", () => { | ||
| cy.get("#movie-list li").first().find(".thumbnail").click(); | ||
|
|
||
| cy.wait("@getMovieId"); | ||
|
|
||
| cy.get("#modalBackground").should('have.length', 1); | ||
|
|
||
| cy.get("#closeModal").click(); | ||
|
|
||
| cy.get("#modalBackground").should('have.length', 0); | ||
| }); | ||
|
|
||
| it("ESC을 입력하면 상세 팝업이 닫힌다.", () => { | ||
| cy.get("#movie-list li").first().find(".thumbnail").click(); | ||
|
|
||
| cy.wait("@getMovieId"); | ||
|
|
||
| cy.get("#modalBackground").should('have.length', 1); | ||
|
|
||
| cy.get("body").type("{esc}"); | ||
|
|
||
| cy.get("#modalBackground").should('have.length', 0); | ||
| }); | ||
|
|
||
| it("평점 별을 눌러서 평점을 매길수 있다.", () => { | ||
| cy.get("#movie-list li").first().find(".thumbnail").click(); | ||
|
|
||
| cy.wait("@getMovieId"); | ||
|
|
||
| const rate = 5; | ||
|
|
||
| cy.get("#detail-modal-star-box .star").eq(rate - 1).click(); | ||
|
|
||
| cy.get("#detail-modal-star-box .star.on").should('have.length', rate); | ||
| }); | ||
|
|
||
| it("매겼던 평점을 다시 확인할 수 있다", () => { | ||
| cy.get("#movie-list li").first().find(".thumbnail").click(); | ||
|
|
||
| cy.wait("@getMovieId"); | ||
|
|
||
| const rate = 5; | ||
|
|
||
| cy.get("#detail-modal-star-box .star").eq(rate - 1).click(); | ||
|
|
||
| cy.get("#detail-modal-star-box .star.on").should('have.length', rate); | ||
|
|
||
| cy.get("#closeModal").click(); | ||
|
|
||
| cy.get("#movie-list li").first().find(".thumbnail").click(); | ||
|
|
||
| cy.get("#detail-modal-star-box .star.on").should('have.length', rate); | ||
| }); | ||
|
|
||
|
|
||
| it("매겼던 평점을 평점의별을 눌러서 다시 평점을 매길 수 있다", () => { | ||
| cy.get("#movie-list li").first().find(".thumbnail").click(); | ||
|
|
||
| cy.wait("@getMovieId"); | ||
|
|
||
| const prevRate = 5; | ||
| const rate = 1; | ||
|
|
||
| cy.get("#detail-modal-star-box .star").eq(prevRate - 1).click(); | ||
|
|
||
| cy.get("#detail-modal-star-box .star.on").should('have.length', prevRate); | ||
|
|
||
| cy.get("#closeModal").click(); | ||
|
|
||
| cy.get("#movie-list li").first().find(".thumbnail").click(); | ||
|
|
||
| cy.get("#detail-modal-star-box .star").eq(rate - 1).click(); | ||
|
|
||
| cy.get("#detail-modal-star-box .star.on").should('have.length', rate); | ||
| }); | ||
| }); |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -32,17 +32,22 @@ describe("영화 목록 조회 기능 테스트", () => { | |
| cy.get("#movie-list li").should("have.length.greaterThan", 0); | ||
| }); | ||
|
|
||
| it("더보기 버튼을 누르면 영화 목록이 추가로 생성되어 렌더링 된다.", () => { | ||
| cy.get("#more-button").click(); | ||
| cy.wait("@getPopularPage2"); | ||
|
|
||
| it("스크롤을 끝까지 내리면 영화 목록이 추가로 생성되어 렌더링 된다.", () => { | ||
| cy.scrollTo('bottom', { duration: 500 }); | ||
| cy.get("#movie-list li").should("have.length.greaterThan", entries); | ||
| }); | ||
|
|
||
| it("마지막 페이지까지 렌더링 됬을때 더보기 버튼을 출력하지 않는다.", () => { | ||
| cy.get("#more-button").click(); | ||
| it("마지막 페이지까지 렌더링 됬을때 스크롤을 끝까지 내려도 영화 리스트를 더 출력하지 않는다.", () => { | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 오타 수정 "렌더링 됬을때" → "렌더링 됐을 때"로 수정하면 좋겠습니다. 🤖 Prompt for AI Agents |
||
| cy.scrollTo('bottom', { duration: 500 }); | ||
|
|
||
| cy.wait("@getPopularPage2"); | ||
|
|
||
| cy.get("#more-button").should("not.be.visible"); | ||
| cy.get("#movie-list li").then((eleBefore) => { | ||
| const prevLength = eleBefore.length; | ||
|
|
||
| cy.scrollTo('bottom', { duration: 500 }); | ||
|
|
||
| cy.get("#movie-list li").should("have.length", prevLength); | ||
| }); | ||
| }); | ||
| }); | ||
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
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
체크리스트 항목 업데이트 필요
PR 설명과 구현된 코드를 보면 상세 팝업, 별점, 무한 스크롤, 반응형 기능이 구현된 것으로 보입니다. 완료된 항목의 체크박스를
[x]로 업데이트하는 것이 좋겠습니다.🤖 Prompt for AI Agents