-
Notifications
You must be signed in to change notification settings - Fork 1
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
Main page/#97 #99
Main page/#97 #99
Conversation
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.
수고하셨습니다 ~
</head> | ||
<body> | ||
<div className="bg-white"> | ||
<Provider> | ||
<MSWComponent> | ||
<NavigationBar /> |
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.
<NavigationBar />
는 메인페이지에도 적용되어야하는 요소 같은데 (sub-page)의 layout으로 옮겨주신 이유가 무엇인가요?
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.
Main page에서는 전체 페이지를 감싸는 요소가 있는데 이 안에서 navigation bar가 존재해야 하기때문에 main page가 존재하지 않는 sub page의 layout으로 옮겨줬습니다!
<div className="bg-primary w-[100vw] h-[100vh] overflow-hidden relative"> | ||
<NavigationBar /> | ||
<Responsive minWidth={768}> | ||
<Image src={mainBookBackground} alt="main-book-background" className="fixed right-0 w-[60%] z-0" /> |
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.
width과 height를 지정하지않았는데 warning이 발생하지 않았나요?
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.
넵 경고는 뜨지 않는데 혹시 문제가 될까요?
await step('drawer 외부 overlay를 클릭하면 drawer가 닫힌다', async () => { | ||
const drawerOverlay = await screen.findByTestId('drawer-overlay'); | ||
await userEvent.click(drawerOverlay); | ||
const toggleLectureSearch = await screen.findByTestId('toggle-lecture-search'); | ||
expect(toggleLectureSearch).toBeInTheDocument(); | ||
}); |
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.
- draw 닫는 시나리오를 추가하여 테스트 실패를 해결한 것 같은데, 시나리오마다 환경을 초기화하는 방법은 없었을까요?
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.
decorator를 사용해서 play 전에 특정 로직을 실행시킬 수 있습니다! 그래서 decorator에 play 전에 drawer를 닫는 로직을 넣어봤습니다.
drawer가 항상 존재하는 것은 아니기에 if( screen.findByTestId('drawer-overlay') )
코드로 drawer 존재 여부에 따라 분기처리를 하려했는데 drawer-overlay element가 존재하지 않다고 오류를 뿜어버립니다. 현재로서 이 분기처리를 마땅히 해결 할 코드를 찾지 못했습니다 🥹
아직 중복되거나 큰 문제가 되지 않아서 추후에 중복이 되거나 이럴때 더 찾아봐도 될까요?
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.
- 아하 혹시나 스토리북에 있는 reset button처럼 이를 수동으로 트리거할 수 있는 API가 스토리북에서 제공되지 않을까 생각해서, 이에 대해 알고 있는지 궁금해서 질문했습니다.
- 지금은 중복되거나 큰 문제가 되진 않으니 나중에 필요할 때 찾아보셔도 좋을 것 같습니다. 저도 찾아보겠습니다
📌 작업 내용
🤔 고민 했던 부분
그렇다면 main page의 url을 /home 으로 변경하고 / 페이지 진입 시 redirect 시키는 방법이 있습니다 하지만 이 방법도 문제가 있습니다
두 방법의 단점을 고려해보았을 때, 후자를 채택할 정도로 페이지 컴포넌트가 필요하지 않아서 따로 main 폴더를 만들지 않았습니다.