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

taken lectures api/#35 #36

Merged
merged 19 commits into from
Feb 29, 2024
Merged

taken lectures api/#35 #36

merged 19 commits into from
Feb 29, 2024

Conversation

gahyuun
Copy link
Member

@gahyuun gahyuun commented Feb 24, 2024

๐Ÿ“Œ ์ž‘์—… ๋‚ด์šฉ

๊ตฌํ˜„ ๋‚ด์šฉ ๋ฐ ์ž‘์—… ํ–ˆ๋˜ ๋‚ด์—ญ

  • msw์™€ fetch๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ๊ธฐ์ด์ˆ˜ ๊ณผ๋ชฉ ๋ฆฌ์ŠคํŠธ api ์—ฐ๊ฒฐ

๐Ÿค” ๊ณ ๋ฏผ ํ–ˆ๋˜ ๋ถ€๋ถ„

  • ์›๋ž˜ ๊ธฐ์ด์ˆ˜ ๊ณผ๋ชฉ์„ completed subjects๋ผ๋Š” ๋„ค์ด๋ฐ์œผ๋กœ ๊ฐ€์ ธ๊ฐ€๋ ค ํ–ˆ์Šต๋‹ˆ๋‹ค ํ•˜์ง€๋งŒ ๋ฐฑ์—”๋“œ์—์„œ ๋„˜๊ฒจ์ฃผ๋Š” ๊ฐ’์˜ ๋„ค์ด๋ฐ์ด taken lectures์˜€๊ณ  ๋ฐฑ์—”๋“œ ๋„ค์ด๋ฐ๊ณผ ๋‹ค๋ฅด๋ฉด ์ข€ ํ—ท๊ฐˆ๋ฆด ๊ฒƒ ๊ฐ™์•„์„œ taken lectures๋ผ๊ณ  ํ–ˆ์Šต๋‹ˆ๋‹ค
  • ํ˜„์žฌ ui ํด๋”์— taken lectures ํด๋”๋Š” ๊ธฐ์ด์ˆ˜ ๊ณผ๋ชฉ์— ๋Œ€ํ•œ ๋„๋ฉ”์ธ ์ปดํฌ๋„ŒํŠธ๊ฐ€ ์กด์žฌํ•  ์˜ˆ์ •์ž…๋‹ˆ๋‹ค. ๋งˆ์ดํŽ˜์ด์ง€ ๊ธฐ์ด์ˆ˜ ๊ณผ๋ชฉ ๋ฆฌ์ŠคํŠธ๋ฅผ taken lecture list๋ผ๊ณ  ๊ฒฐ์ •ํ–ˆ๊ธฐ์— ๊ฒฐ๊ณผ ํŽ˜์ด์ง€์— ์žˆ๋Š” ๊ธฐ์ด์ˆ˜ ๊ณผ๋ชฉ ๋ฆฌ์ŠคํŠธ๋Š” taken category lecture list ์ •๋„๋กœ ์ƒ๊ฐํ•˜๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค
  • fetch์—์„œ error ์ฒ˜๋ฆฌ๋Š” ์•„์ง ์ง„ํ–‰ํ•˜์ง€ ์•Š์•˜์Šต๋‹ˆ๋‹ค
  • taken lecture title ์ปดํฌ๋„ŒํŠธ๋ฅผ ์ƒ์„ฑํ–ˆ์Šต๋‹ˆ๋‹ค. ์ด ์ปดํฌ๋„ŒํŠธ๋ฅผ ๋„๋ฉ”์ธ ์ปดํฌ๋„ŒํŠธ๋กœ ๋ถ„๋ฆฌํ• ๊นŒ, view ์ปดํฌ๋„ŒํŠธ๋กœ ๋ถ„๋ฆฌํ• ๊นŒ ๊ณ ๋ฏผ์„ ํ–ˆ์—ˆ๋Š”๋ฐ ์•„๋ž˜ ์ด์œ ๋กœ ๋„๋ฉ”์ธ ์ปดํฌ๋„ŒํŠธ๋กœ ๋ถ„๋ฆฌํ–ˆ์Šต๋‹ˆ๋‹ค
  1. ์žฌ์‚ฌ์šฉ์ด ๋˜๊ธด ํ•ด๋„ taken lecture ๋„๋ฉ”์ธ์„ ๊ฐ€์ง„ ์ปดํฌ๋„ŒํŠธ์—์„œ๋งŒ ์žฌ์‚ฌ์šฉ์ด ๋œ๋‹ค
  2. ์—ญํ• ์„ ์ƒ๊ฐํ–ˆ์„ ๋•Œ ๋„๋ฉ”์ธ์— ์ข…์†๋œ๋‹ค ( ๋„ค์ด๋ฐ๋„ taken lecture ๋‹จ์–ด๋ฅผ ํฌํ•จ ์‹œํ‚ค์ง€ ์•Š๊ณ  ์ง“๊ธฐ ์• ๋งคํ•˜๋‹ค)

ํ…Œ์ด๋ธ” ์ปดํฌ๋„ŒํŠธ์— ๋Œ€ํ•œ ๋ฆฌํŒฉํ† ๋ง

  1. table component์—์„œ ์ „๋‹ฌ ๋ฐ›๋Š” data์˜ ํƒ€์ž…์„ (string||number)[][] => {id:number;[key:string]:string|number}[] ํƒ€์ž…์œผ๋กœ ๋ณ€๊ฒฝํ–ˆ์Šต๋‹ˆ๋‹ค
  • ๋ฐฐ์—ด์—์„œ ๊ฐ์ฒด๋กœ ๋ฐ”๊พผ ์ด์œ  => id ํ•„๋“œ๊ฐ€ ํ•„์š”ํ–ˆ๊ณ  id ํ•„๋“œ๋งŒ ๋”ฐ๋กœ ๊ตฌ๋ถ„ํ•˜๊ธฐ ์œ„ํ•ด์„œ ๊ฐ์ฒด๋กœ ๋ณ€๊ฒฝํ–ˆ์Šต๋‹ˆ๋‹ค
  • id ํ•„๋“œ๊ฐ€ ํ•„์š”ํ•œ ์ด์œ  => action button ํด๋ฆญ ์‹œ ํ•ด๋‹น ๊ณผ๋ชฉ์˜ ์•„์ด๋””๊ฐ€ ํ•„์š”ํ•ฉ๋‹ˆ๋‹ค!
  1. action button์„ JSX Element๊ฐ€ ์•„๋‹Œ JSX Element ๋ฅผ returnํ•˜๋Š” ํ•จ์ˆ˜๋กœ ๋ณ€๊ฒฝํ–ˆ์Šต๋‹ˆ๋‹ค
  • id ํ•„๋“œ๊ฐ€ ํ•„์š”ํ•œ ์ด์œ ๋ž‘ ๊ฐ™์€ ๋งฅ๋ฝ์ธ๋ฐ action button ํด๋ฆญ ์‹œ ํ•ด๋‹น ๊ณผ๋ชฉ์˜ id (row์— ์กด์žฌํ•˜๋Š” ๊ณผ๋ชฉ ์ •๋ณด์˜ ์•„์ด๋””) ๊ฐ€ ํ•„์š”ํ•˜๊ณ  ์ด๋ฅผ ๊ฐ€์ ธ์˜ค๊ธฐ ์œ„ํ•ด ํ•จ์ˆ˜๋กœ ๋ณ€๊ฒฝํ–ˆ์Šต๋‹ˆ๋‹ค

์˜๋„ํ•œ ๊ฑด ์•„๋‹ˆ์ง€๋งŒ data์˜ ํƒ€์ž…์„ ๊ฐ์ฒด๋กœ ๋ณ€๊ฒฝํ•œ ํ›„ parseTakenLecture ๋ผ๋Š” ํ•จ์ˆ˜๋Š” ๋ถˆํ•„์š”ํ•ด์ ธ์„œ ์ œ๊ฑฐํ–ˆ์Šต๋‹ˆ๋‹ค!

@gahyuun gahyuun self-assigned this Feb 24, 2024
Copy link

Copy link
Collaborator

@seonghunYang seonghunYang left a comment

Choose a reason for hiding this comment

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

  • ์ˆ˜๊ณ ํ•˜์…จ์Šต๋‹ˆ๋‹ค. ์ž‘์—…ํ•˜์‹  ๋‚ด์šฉ์„ ๊ผผ๊ผผํžˆ ๊ฒ€ํ† ํ•˜์˜€์Šต๋‹ˆ๋‹ค.
  • ๋ช‡ ๊ฐ€์ง€ ์˜๊ฒฌ๊ณผ ์ œ์•ˆ์„ ๋‚จ๊ฒผ์Šต๋‹ˆ๋‹ค. ํ™•์ธํ•˜์‹œ๊ณ  ์˜๊ฒฌ์„ ๋ถ€ํƒ๋“œ๋ฆฝ๋‹ˆ๋‹ค.

Comment on lines 17 to 19
const response = await fetch(API_PATH.takenLectures);
const data = await response.json();
return data;
Copy link
Collaborator

Choose a reason for hiding this comment

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

[comment]

  • ํ˜„์žฌ ์š”๊ตฌ์‚ฌํ•ญ์—๋Š” ์—๋Ÿฌ ๋ฐœ์ƒ ์‹œ์˜ ์ฒ˜๋ฆฌ ๋ฐฉ์•ˆ์ด ํฌํ•จ๋˜์–ด ์žˆ์ง€ ์•Š์Šต๋‹ˆ๋‹ค. ์ด ๋ถ€๋ถ„์— ๋Œ€ํ•œ ์ •์˜๊ฐ€ ํ•„์š”ํ•˜๋ฏ€๋กœ, ํšŒ๊ณ  ์‹œ๊ฐ„์— ๋…ผ์˜ํ•ด๋ด…์‹œ๋‹ค!

Comment on lines 3 to 5
type ListRootProps = {
data: (string | number)[][];
render: (item: (string | number)[], index: number) => ReactNode;
Copy link
Collaborator

Choose a reason for hiding this comment

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

[comment]

  • ์ œ๋„ค๋ฆญ์—์„œ string์ด๋ž‘ number๋กœ๋งŒ ํƒ€์ž…์„ ์ œํ•œํ•œ ์ด์œ ๊ฐ€ ์žˆ์„๊นŒ์š”?

Copy link
Member Author

Choose a reason for hiding this comment

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

table column์—๋Š” string number ์™ธ ๋ฐ์ดํ„ฐ ํƒ€์ž…์ด ๋“ค์–ด์˜ฌ ์ƒํ™ฉ์ด ์—†์„ ๊ฒƒ ๊ฐ™์•„์„œ ์ œํ•œ์„ ์‹œ์ผฐ์Šต๋‹ˆ๋‹ค!

Copy link
Collaborator

Choose a reason for hiding this comment

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

[request change]

  • ์ œ ์ƒ๊ฐ์—๋Š” ํ˜„์žฌ 'taken-lecture-title' ์ปดํฌ๋„ŒํŠธ์˜ ๋ถ„๋ฆฌ ์ˆ˜์ค€์„ ๊ณ ๋ คํ–ˆ์„ ๋•Œ, 'taken-lecture-title' ์ปดํฌ๋„ŒํŠธ๊ฐ€ view ์ปดํฌ๋„ŒํŠธ๋กœ ๋” ์ ์ ˆํ•ด ๋ณด์ž…๋‹ˆ๋‹ค. ์ด์œ ๋Š” ๋‹ค์Œ๊ณผ ๊ฐ™์Šต๋‹ˆ๋‹ค:
    • 'taken-lecture-title' ์ปดํฌ๋„ŒํŠธ ๋‚ด๋ถ€์—๋Š” ๋น„์ฆˆ๋‹ˆ์Šค ๋„๋ฉ”์ธ ๋กœ์ง์ด ์—†์Šต๋‹ˆ๋‹ค.
    • ๋”ฐ๋ผ์„œ 'taken-lecture-title' ์ปดํฌ๋„ŒํŠธ๋Š” ํ˜„์žฌ view ๊ด€์‹ฌ์‚ฌ๋งŒ์„ ์ˆ˜ํ–‰ํ•˜๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค.
      • view ๊ด€์‹ฌ์‚ฌ๋Š” props๋ฅผ ๋ฐ›์•„ ํ™”๋ฉด์— ๊ทธ๋ ค์ฃผ๋Š” presentational component๋ฅผ ๋œปํ•ฉ๋‹ˆ๋‹ค.
  • 'ํ˜„์žฌ ๋ถ„๋ฆฌ ์ˆ˜์ค€'์ด๋ผ๊ณ  ๋งํ•œ ๊ฒƒ์€ '์ปค์Šคํ…€ํ•˜๊ธฐ'์™€ '์—…๋ฐ์ดํŠธ' ๋ฒ„ํŠผ์— ๋„๋ฉ”์ธ ๋กœ์ง์ด ์ถ”๊ฐ€๋  ์ˆ˜ ์žˆ๊ธฐ ๋•Œ๋ฌธ์ž…๋‹ˆ๋‹ค. ๋งŒ์•ฝ ๊ทธ๋ ‡๊ฒŒ ๋œ๋‹ค๋ฉด 'taken-lecture-title' ์ปดํฌ๋„ŒํŠธ๋Š” props๋กœ ๋ฒ„ํŠผ์„ ๋ฐ›๋Š” ๊ฒƒ์ด ์•„๋‹ˆ๋ผ, ๋‚ด๋ถ€์—์„œ ์ž์ฒด์ ์œผ๋กœ '์ปค์Šคํ…€ํ•˜๊ธฐ'์™€ '์—…๋ฐ์ดํŠธ' ๋ฒ„ํŠผ์„ ๋ Œ๋”๋งํ•˜๊ฒŒ ๋ฉ๋‹ˆ๋‹ค. ํ•ด๋‹น ๋น„์ฆˆ๋‹ˆ์Šค ๋„๋ฉ”์ธ ๋กœ์ง์ด 'taken-lecture-title' ์ปดํฌ๋„ŒํŠธ์— ์œ„์น˜ํ•œ๋‹ค๋ฉด, ๋„๋ฉ”์ธ ์ปดํฌ๋„ŒํŠธ๊ฐ€ ๋” ์ ์ ˆํ•˜๋‹ค๊ณ  ๋ณผ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
    • ๊ฒฐ๊ตญ ๋„๋ฉ”์ธ ์ปดํฌ๋„ŒํŠธ๋กœ ๋ถ„๋ฆฌํ•˜๊ธฐ ์œ„ํ•ด์„œ๋Š” ํ•ด๋‹น ๋ฒ„ํŠผ์„ props๋กœ ๋ฐ›๋Š” ๊ฒƒ์ด ์•„๋‹ˆ๋ผ, ๋‚ด๋ถ€์—์„œ ๋ Œ๋”๋งํ•˜๊ณ  ๊ฑฐ๊ธฐ์— ๋น„์ฆˆ๋‹ˆ์Šค ๋„๋ฉ”์ธ ๋กœ์ง์„ ์ž‘์„ฑํ•  ํ•„์š”๊ฐ€ ์žˆ์–ด๋ณด์ด๋„ค์š”!

Copy link
Member Author

Choose a reason for hiding this comment

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

์•— ๋„๋ฉ”์ธ ๋กœ์ง์ด ํฌํ•จ๋˜์–ด์žˆ์ง€ ์•Š๊ณ  ๋ Œ๋”๋ง๋งŒ ํ•œ๋‹ค๋Š” ๊ด€์ ์—์„œ๋Š” view component๊ฐ€ ์ ์ ˆํ•  ๊ฒƒ ๊ฐ™๋„ค์š”!
์ €๋Š” ๋„๋ฉ”์ธ ์ปดํฌ๋„ŒํŠธ์˜ ์ •์˜๋ฅผ ๋„๋ฉ”์ธ์— ์ข…์†๋œ๋‹ค๊ณ  ์ƒ๊ฐํ•ด์„œ ๊ทธ๋ ‡๊ฒŒ ๋ถ„๋ฆฌ๋ฅผ ํ–ˆ์Šต๋‹ˆ๋‹ค!
taken lecture title์€ "๊ธฐ์ด์ˆ˜ ๊ณผ๋ชฉ์— ๋Œ€ํ•œ ์ •๋ณด(์ œ๋ชฉ)์„ ๋ Œ๋”๋งํ•œ๋‹ค" ๋ผ๋Š” ์—ญํ• ๋กœ ์ •์˜ํ•  ์ˆ˜ ์žˆ๊ณ  ์—ญํ• ์ด ๋„๋ฉ”์ธ์— ์ข…์† ๋œ๋‹ค๊ณ  ์ƒ๊ฐํ•ด์„œ ๋„๋ฉ”์ธ ์ปดํฌ๋„ŒํŠธ๋กœ ๋ถ„๋ฆฌํ–ˆ์Šต๋‹ˆ๋‹ค
ํ˜น์‹œ ์ด์— ๋Œ€ํ•ด์„œ๋Š” ์–ด๋–ป๊ฒŒ ์ƒ๊ฐํ•˜์‹œ๋‚˜์š”??

Copy link
Collaborator

Choose a reason for hiding this comment

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

  • ์ข‹์€ ์˜๊ฒฌ์ด๋„ค์š”. "๊ธฐ์ด์ˆ˜ ๊ณผ๋ชฉ์— ๋Œ€ํ•œ ์ •๋ณด(์ œ๋ชฉ)์„ ๋ Œ๋”๋งํ•œ๋‹ค"๋ผ๋Š” ์—ญํ• ๋กœ ์ •์˜ํ•˜๋ฉด ๋„๋ฉ”์ธ ์ปดํฌ๋„ŒํŠธ๊ฐ€ ๋งž์Šต๋‹ˆ๋‹ค. ํ•˜์ง€๋งŒ ์ œ ์˜๊ฒฌ์œผ๋ก  ํ˜„์žฌ taken lecture title ์ปดํฌ๋„ŒํŠธ๊ฐ€ ํ•ด๋‹น ์—ญํ• ์„ ์ถฉ์‹คํžˆ ์ˆ˜ํ–‰ํ•˜๊ณ  ์žˆ๋‹ค๊ณ  ๋ณด์ด์ง€๋Š” ์•Š์Šต๋‹ˆ๋‹ค. ์ด ๋ถ€๋ถ„์— ๋Œ€ํ•ด ํšŒ๊ณ  ์‹œ๊ฐ„์— ๋” ์ด์•ผ๊ธฐํ•ด ๋ณด๋ฉด ์ข‹์„ ๊ฒƒ ๊ฐ™๋„ค์š”!

Copy link
Collaborator

Choose a reason for hiding this comment

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

[comment]

  • ๋„๋ฉ”์ธ ์ปดํฌ๋„ŒํŠธ๊ฐ€ ์ ์ ˆํ•˜๊ฒŒ ์ž‘์„ฑ๋œ ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค.
  • ๋˜ํ•œ, ์ €๋Š” ๋„๋ฉ”์ธ ์ปดํฌ๋„ŒํŠธ์— ๋Œ€ํ•œ ํ…Œ์ŠคํŠธ๊ฐ€ ๋ฐ˜๋“œ์‹œ ํ•„์š”ํ•˜๋‹ค๊ณ  ์ƒ๊ฐํ•ฉ๋‹ˆ๋‹ค. ๊ทธ๋ž˜์„œ ๋„๋ฉ”์ธ ์ปดํฌ๋„ŒํŠธ์— ๋Œ€ํ•œ ํ…Œ์ŠคํŠธ ์ž‘์„ฑ์„ ์ œ์•ˆํ•˜๊ณ ์ž ํ•˜๋Š”๋ฐ, ๋‹ค๋ฅธ ๋ถ„๋“ค์˜ ์˜๊ฒฌ์€ ์–ด๋– ์‹ ๊ฐ€์š”?

Copy link
Member

@yougyung yougyung Feb 24, 2024

Choose a reason for hiding this comment

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

๋„๋ฉ”์ธ ์ปดํฌ๋„ŒํŠธ์— ๋Œ€ํ•œ ํ…Œ์ŠคํŠธ๊ฐ€ ๋ฐ˜๋“œ์‹œ ํ•„์š”ํ•˜๋‹ค๊ณ  ์ƒ๊ฐํ•˜์‹œ๋Š” ์ด์œ ๋ฅผ ์—ฌ์ญค๋ณผ ์ˆ˜ ์žˆ์„๊นŒ์š”?

Copy link
Collaborator

@seonghunYang seonghunYang Feb 25, 2024

Choose a reason for hiding this comment

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

์Œ.. ์ œ๊ฐ€ ์ „์— ๋งŽ์ด ๊ณ ๋ฏผํ–ˆ๋˜ ์ฃผ์ œ๋ผ ๊ณ ๋ฏผ์˜ ํ๋ฆ„์„ ๋‚จ๊ฒจ๋ณด๊ฒ ์Šต๋‹ˆ๋‹ค. ๋„์›€์ด ๋˜์—ˆ์œผ๋ฉด ์ข‹๊ฒ ๋„ค์š” :)

  1. ์ฒซ ๋ฒˆ์งธ๋กœ ๊ณ ๋ คํ•ด์•ผ ํ•  ์ค‘์š”ํ•œ ์งˆ๋ฌธ์€ "์–ด๋–ค ํ…Œ์ŠคํŠธ ์ฝ”๋“œ๋ฅผ ์ž‘์„ฑํ•˜๋ฉด ๊ฐ€์žฅ ํšจ๊ณผ์ ์ผ๊นŒ?"์ž…๋‹ˆ๋‹ค. 'ํšจ๊ณผ์ '์ด๋ž€ ๊ฐ€์žฅ ์ ์ ˆํ•œ ์ฝ”๋“œ์˜ ์–‘์œผ๋กœ "์• ํ”Œ๋ฆฌ์ผ€์ด์…˜์ด ์˜๋„๋Œ€๋กœ ๋™์ž‘ํ•จ์„ ๊ฒ€์ฆ"ํ•˜๋Š” ํ…Œ์ŠคํŠธ์˜ ๋ชฉ์ ์„ ๋‹ฌ์„ฑํ•˜๋Š” ๊ฒƒ์„ ์˜๋ฏธํ•ฉ๋‹ˆ๋‹ค. ํ…Œ์ŠคํŠธ ์ฝ”๋“œ๋ฅผ ์ž‘์„ฑํ•˜๋Š” ๊ณผ์ •์—์„œ ๋ชจ๋“  ๊ฒƒ์— ๋Œ€ํ•œ ํ…Œ์ŠคํŠธ ์ฝ”๋“œ๋ฅผ ์ž‘์„ฑํ•˜๋Š” ๊ฒƒ์€ ์ง€๋ฃจํ•˜๊ณ , ์ƒ๋‹นํžˆ ์†Œ๋ชจ์ ์ด๋ฉฐ ๋•Œ๋ก  ๋ถˆ๊ฐ€๋Šฅํ•˜๋‹ค๋Š” ๊ฒƒ์„ ์•Œ๊ฒŒ ๋ฉ๋‹ˆ๋‹ค. ๋”ฐ๋ผ์„œ, ์–ด๋–ป๊ฒŒ ๊ฐ€์žฅ ์ ์ ˆํ•œ ํ…Œ์ŠคํŠธ ์ฝ”๋“œ๋ฅผ ์ž‘์„ฑํ•  ๊ฒƒ์ธ์ง€์— ๋Œ€ํ•œ ๊ณ ๋ฏผ์ด ํ•„์š”ํ•ฉ๋‹ˆ๋‹ค. ์ด ์งˆ๋ฌธ์— ๋Œ€ํ•œ ๋‹ต์„ ์ฐพ๊ธฐ ์œ„ํ•ด ์—ฌ๋Ÿฌ ์ฐธ๊ณ ์ž๋ฃŒ๋ฅผ ๊ฒ€ํ† ํ–ˆ์Šต๋‹ˆ๋‹ค.
  2. ๊ฐ€์žฅ ๋จผ์ € ์‚ดํŽด๋ณธ ๊ฒƒ์€ ๋งˆํ‹ด ํŒŒ์šธ๋Ÿฌ์˜ "ํ…Œ์ŠคํŠธ ํ”ผ๋ผ๋ฏธ๋“œ"์ž…๋‹ˆ๋‹ค. ๊ฐ„๋‹จํžˆ ๋งํ•˜๋ฉด, ์œ ๋‹› ํ…Œ์ŠคํŠธ > ํ†ตํ•ฉ ํ…Œ์ŠคํŠธ > E2E ํ…Œ์ŠคํŠธ์˜ ์ˆœ์„œ๋กœ ํ…Œ์ŠคํŠธ ์ฝ”๋“œ๋ฅผ ์ž‘์„ฑํ•˜๋Š” ๊ฒƒ์ž…๋‹ˆ๋‹ค. FE ๊ด€์ ์—์„œ๋Š” ๋กœ์ง์„ ๊ฐ€์ง„ ํ›…๊ณผ ์ปดํฌ๋„ŒํŠธ๊ฐ€ ์œ ๋‹› ํ…Œ์ŠคํŠธ ๋‹จ์œ„๋ผ๊ณ  ์ƒ๊ฐํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ์ด์— ๋Œ€ํ•œ ์ž์„ธํ•œ ๋‚ด์šฉ์€ ์•„๋ž˜์— ์ฒจ๋ถ€๋œ ๊ธ€์„ ์ฐธ๊ณ ํ•˜์‹œ๊ธฐ ๋ฐ”๋ž๋‹ˆ๋‹ค.
    ์›๋ฌธ: https://martinfowler.com/bliki/TestPyramid.html
    ๋ฒˆ์—ญ: https://blog.voidmainvoid.net/451
    (์›๋ฌธ์„ ์ฝ๋Š” ๊ฒƒ์„ ์ถ”์ฒœ๋“œ๋ฆฝ๋‹ˆ๋‹ค. ์ฐธ๊ณ ๋กœ ๋งˆํ‹ด ํŒŒ์šธ๋Ÿฌ๋Š” ์ œ๊ฐ€ ๊ฐ€์žฅ ์ข‹์•„ํ•˜๋Š” ํ”„๋กœ๊ทธ๋ž˜๋จธ ์ค‘ ํ•œ๋ช…์ž…๋‹ˆ๋‹ค)
  3. ํ•˜์ง€๋งŒ "ํ…Œ์ŠคํŠธ ํ”ผ๋ผ๋ฏธ๋“œ"์— ๋Œ€ํ•ด ์˜๋ฌธ์ด ์ƒ๊ฒผ์Šต๋‹ˆ๋‹ค. ๊ทธ ์˜๋ฌธ์€ "FE์—์„œ๋„ ์ด 'ํ…Œ์ŠคํŠธ ํ”ผ๋ผ๋ฏธ๋“œ'๊ฐ€ ์œ ํšจํ•œ๊ฐ€?"์ž…๋‹ˆ๋‹ค. ์ œ ๊ฒฝํ—˜์ƒ BE ๊ด€์ ์—์„œ๋Š” ํ…Œ์ŠคํŠธ ํ”ผ๋ผ๋ฏธ๋“œ๊ฐ€ ์œ ํšจํ•ฉ๋‹ˆ๋‹ค. ์ด๋Š” ๋„๋ฉ”์ธ > ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜ > ์–ด๋Œ‘ํ„ฐ์˜ ์˜์กด์„ฑ ํ๋ฆ„์ด ์œ ๋‹› ํ…Œ์ŠคํŠธ > ํ†ตํ•ฉ ํ…Œ์ŠคํŠธ > E2E ํ…Œ์ŠคํŠธ์˜ ํ๋ฆ„๊ณผ ์ผ์น˜ํ•˜๊ธฐ ๋•Œ๋ฌธ์ž…๋‹ˆ๋‹ค. ๊ทธ๋Ÿฌ๋‚˜ FE์—์„œ๋Š” ๊ทธ๋ ‡์ง€ ์•Š์Šต๋‹ˆ๋‹ค. ๋น„์ฆˆ๋‹ˆ์Šค ๋กœ์ง๊ณผ ์ปดํฌ๋„ŒํŠธ๋Š” ๊ฐ๊ธฐ ๋‹ค๋ฅธ ๊ณ„์ธต์„ ๊ฐ€์ง€๋ฉฐ, ๋‘˜์€ ๋ฐ˜๋“œ์‹œ ๊ฒฐํ•ฉํ•ด์„œ ์ž‘๋™ํ•ฉ๋‹ˆ๋‹ค. ์ฆ‰, ๋กœ์ง๊ณผ ์ปดํฌ๋„ŒํŠธ๊ฐ€ ๊ฒฐํ•ฉ๋˜์–ด ์ œ๋Œ€๋กœ ๋™์ž‘ํ•˜๋Š” ๊ฒƒ์„ ํ™•์ธํ•ด์•ผ "์• ํ”Œ๋ฆฌ์ผ€์ด์…˜์ด ์˜๋„๋Œ€๋กœ ์ž‘๋™ํ•˜๋Š” ๊ฒƒ์„ ๊ฒ€์ฆ"ํ•˜๋Š” ๋ชฉํ‘œ๋ฅผ ๋‹ฌ์„ฑํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ํ•˜์ง€๋งŒ ์—„๋ฐ€ํžˆ ๋งํ•˜๋ฉด, ๋น„์ฆˆ๋‹ˆ์Šค ๋กœ์ง๊ณผ ์ปดํฌ๋„ŒํŠธ๊ฐ€ ๊ฒฐํ•ฉ๋œ ํ…Œ์ŠคํŠธ(๋„๋ฉ”์ธ ์ปดํฌ๋„ŒํŠธ๋ผ๊ณ  ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค)๋Š” ํ†ตํ•ฉ ํ…Œ์ŠคํŠธ์— ๊ฐ€๊น์Šต๋‹ˆ๋‹ค.
  4. ์ด ์˜๋ฌธ์„ ํ•ด๊ฒฐํ•˜๊ธฐ ์œ„ํ•ด ๋‹ค์–‘ํ•œ ์‚ฌ๋žŒ๋“ค์˜ ์˜๊ฒฌ์„ ์ˆ˜์ง‘ํ–ˆ๊ณ , ์ด ๋ฌธ์ œ๊ฐ€ ๋‚˜๋งŒ์˜ ๋ฌธ์ œ๊ฐ€ ์•„๋‹ˆ๋ผ๋Š” ์‚ฌ์‹ค์„ ๊นจ๋‹ฌ์•˜์Šต๋‹ˆ๋‹ค.
    img
  • ์š”์•ฝํ•˜๋ฉด, ๋งˆํ‹ด ํŒŒ์šธ๋Ÿฌ์˜ "ํ…Œ์ŠคํŠธ ํ”ผ๋ผ๋ฏธ๋“œ"๋Š” ๊ตฌ์‹์ด๋ฉฐ, ํ†ตํ•ฉ ํ…Œ์ŠคํŠธ๋ฅผ ์œ ๋‹› ํ…Œ์ŠคํŠธ๋ณด๋‹ค ๋งŽ์ด ์ž‘์„ฑํ•˜๋Š” ๊ฒƒ์ด ๋” ํ˜„๋ช…ํ•˜๋‹ค๋Š” ์ฃผ์žฅ์ž…๋‹ˆ๋‹ค. ์ด ํ…Œ์ŠคํŠธ ๋ชจ๋ธ์„ FE ๋ถ„์•ผ์—์„œ๋Š” "ํŠธ๋กœํ”ผ ํ…Œ์ŠคํŠธ"๋ผ๊ณ  ๋ถ€๋ฆ…๋‹ˆ๋‹ค.
  1. ๊ทธ ๋‹ค์Œ์œผ๋กœ ํŠธ๋กœํ”ผ ํ…Œ์ŠคํŠธ์˜ ๊ฐœ๋…์„ ์ œ์•ˆํ•œ ์‚ฌ๋žŒ์ธ Kent C.Dodds์˜ ๊ธ€์„ ์ฐพ์•„ ์ฝ์—ˆ์Šต๋‹ˆ๋‹ค. ๊ทธ์˜ ๊ธ€์„ ์š”์•ฝํ•˜๋ฉด, ํ†ตํ•ฉ ํ…Œ์ŠคํŠธ๋Š” ์œ ๋‹› ํ…Œ์ŠคํŠธ๋ณด๋‹ค ๋” ์ ์€ ์ฝ”๋“œ๋กœ ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜์˜ ์˜๋„๋Œ€๋กœ ์ž‘๋™ํ•จ์„ ๋” ์ž˜ ๋ณด์žฅํ•  ์ˆ˜ ์žˆ๊ธฐ ๋•Œ๋ฌธ์— ํ†ตํ•ฉ ํ…Œ์ŠคํŠธ๋ฅผ ์ž‘์„ฑํ•ด์•ผ ํ•œ๋‹ค๊ณ  ํ•ฉ๋‹ˆ๋‹ค. ํ•ด๋‹น ๊ธ€์„ ์•„๋ž˜์— ์ฒจ๋ถ€ํ•ฉ๋‹ˆ๋‹ค.
    Write tests. Not too many. Mostly integration: https://kentcdodds.com/blog/write-tests
    ("Not too many. Mostly integration"์ด๋ผ๋Š” ์ œ๋ชฉ์ด ์ธ์ƒ์ ์ž…๋‹ˆ๋‹ค. ์ฐธ๊ณ ๋กœ, Kent C.Dodds๋Š” ์œ ๋ช… FE ๊ฐœ๋ฐœ์ž์ด๋ฉฐ RTL๋ฅผ ๊ฐœ๋ฐœํ–ˆ์Šต๋‹ˆ๋‹ค.)
  2. ์ •๋ฆฌํ•˜๋ฉด ์šฐ๋ฆฌ๋Š” โ€œ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜์ด ์˜๋„๋Œ€๋กœ ๋™์ž‘ํ•จโ€์„ ๋ณด์žฅํ•˜๊ธฐ ์œ„ํ•ด์„œ ํ…Œ์ŠคํŠธ ์ฝ”๋“œ๋ฅผ ์ž‘์„ฑํ•ด์•ผํ•ฉ๋‹ˆ๋‹ค. ๊ทธ๋Ÿฌ๋‚˜ ์šฐ๋ฆฌ์˜ ์‹œ๊ฐ„์€ ์ œํ•œ๋˜์–ด ์žˆ๊ธฐ ๋•Œ๋ฌธ์— ์–ด๋–ค ํ…Œ์ŠคํŠธ์— ์‹œ๊ฐ„์„ ํˆฌ์žํ• ์ง€ ๊ฒฐ์ •ํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค. ์ „ํ†ต์ ์ธ "ํ…Œ์ŠคํŠธ ํ”ผ๋ผ๋ฏธ๋“œ" ๋ชจํ˜•์ด ์žˆ์ง€๋งŒ, ์ด๋Š” ํ˜„๋Œ€ ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜๊ณผ ํ”„๋ก ํŠธ์—”๋“œ์—๋Š” ์ ํ•ฉํ•˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค. ์ด๋Š” ์œ ๋‹›ํ…Œ์ŠคํŠธ๊ฐ€ ๋” ๋งŽ์€ ํ…Œ์ŠคํŠธ ์ฝ”๋“œ๋ฅผ ์ž‘์„ฑํ•˜๋„๋ก ์š”๊ตฌํ•˜๋ฉฐ, ํ”„๋ก ํŠธ์—”๋“œ์—์„œ๋Š” ์œ ๋‹›ํ…Œ์ŠคํŠธ ํ†ต๊ณผ๊ฐ€ ์˜๋„ํ•œ ๋™์ž‘์„ ๋ณด์žฅํ•˜์ง€ ์•Š๊ธฐ ๋•Œ๋ฌธ์ž…๋‹ˆ๋‹ค(์ด๋Š” ๋กœ์ง๊ณผ ์ปดํฌ๋„ŒํŠธ๊ฐ€ ๊ฒฐํ•ฉ๋œ ํ”„๋ก ํŠธ์—”๋“œ์˜ ํŠน์„ฑ ๋•Œ๋ฌธ์ด๋ผ๊ณ  ์ƒ๊ฐํ•ฉ๋‹ˆ๋‹ค). ์ด์— ๋Œ€ํ•œ ๋Œ€์•ˆ์œผ๋กœ, ํ†ตํ•ฉ ํ…Œ์ŠคํŠธ๋ฅผ ์ž‘์„ฑํ•˜๋Š” ๊ฒƒ์„ ์ œ์•ˆํ•ฉ๋‹ˆ๋‹ค. ์ด๋ฅผ ๊ฐœ๋…์ ์œผ๋กœ ํŠธ๋กœํ”ผ ํ…Œ์ŠคํŠธ ๋ชจํ˜•์ด๋ผ ๋ถ€๋ฅด๋ฉฐ, ์šฐ๋ฆฌ ํ”„๋กœ์ ํŠธ์—์„œ๋Š” ๋„๋ฉ”์ธ ์ปดํฌ๋„ŒํŠธ์— ๋Œ€ํ•œ ํ…Œ์ŠคํŠธ๊ฐ€ ์ ํ•ฉํ•˜๋‹ค๊ณ  ํŒ๋‹จํ–ˆ์Šต๋‹ˆ๋‹ค.

Copy link
Collaborator

@seonghunYang seonghunYang Feb 25, 2024

Choose a reason for hiding this comment

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

(๋ฒˆ์™ธ): ๋งˆํ‹ด ํŒŒ์šธ๋Ÿฌ๊ฐ€ ํ…Œ์ŠคํŠธ ํ”ผ๋ผ๋ฏธ๋“œ์— ๋Œ€ํ•œ ๋…ผ๋ž€์— ๋‹ตํ•œ ๊ธ€์ด ์žˆ์Šต๋‹ˆ๋‹ค. ๊ทธ๋Š” ์‚ฌ๋žŒ๋“ค์ด ํ†ตํ•ฉ ํ…Œ์ŠคํŠธ์— ๊ด€ํ•œ ์˜คํ•ด๋ฅผ ๊ฐ€์ง€๊ณ  ์žˆ๋‹ค๊ณ  ์ง€์ ํ•˜๋ฉฐ, ์ž์‹ ์˜ ์ƒ๊ฐ์— ๋”ฐ๋ฅด๋ฉด ํ†ตํ•ฉ ํ…Œ์ŠคํŠธ๋Š” ๊ฐœ๋ฐœ์ž๊ฐ€ ์•„๋‹Œ ๋‹ค๋ฅธ ์‚ฌ๋žŒ์ด ์ž‘์„ฑํ•œ ํ…Œ์ŠคํŠธ ์ฝ”๋“œ๋กœ ํ…Œ์ŠคํŠธํ•˜๋Š” ๊ฒฝ์šฐ๋ฅผ ๊ฐ€๋ฆฌํ‚จ๋‹ค๊ณ  ๋ฐํ˜”์Šต๋‹ˆ๋‹ค. ๊ทธ๋ฆฌ๊ณ  ์‚ฌ๋žŒ๋“ค์ด ์ผ๋ฐ˜์ ์œผ๋กœ ์ด์•ผ๊ธฐํ•˜๋Š” ํ†ตํ•ฉํ…Œ์ŠคํŠธ (์ฆ‰, ํŠธ๋กœํ”ผ ํ…Œ์ŠคํŠธ์— ํ•ด๋‹นํ•˜๋Š” ํ†ตํ•ฉํ…Œ์ŠคํŠธ)๋Š” ์ž์‹ ์ด ์ •์˜ํ•œ sociable unittest์— ํ•ด๋‹นํ•˜๋ฉฐ, ์ผ๋ฐ˜์ ์œผ๋กœ ์–ธ๊ธ‰๋˜๋Š” ์œ ๋‹›ํ…Œ์ŠคํŠธ๋Š” solitary unittest์— ํ•ด๋‹นํ•œ๋‹ค๊ณ  ์„ค๋ช…ํ–ˆ์Šต๋‹ˆ๋‹ค. ๊ด€์‹ฌ ์žˆ์œผ์‹œ๋ฉด ์•„๋ž˜ ๋งํฌ ์ฝ์–ด๋ณด์„ธ์š”!

https://martinfowler.com/articles/2021-test-shapes.html

Copy link
Member Author

Choose a reason for hiding this comment

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

ํ…Œ์ŠคํŠธ๋ฅผ ํ•ด์•ผ ํ•˜๋Š” ์ด์œ ์— ๋Œ€ํ•ด ํ™•์ธํ–ˆ์Šต๋‹ˆ๋‹ค!
์ถ”๊ฐ€์ ์œผ๋กœ ์ €๋Š” ๊ถ๊ธˆํ•œ๊ฒŒ ์žˆ๋Š”๋ฐ, ๋„๋ฉ”์ธ ์ปดํฌ๋„ŒํŠธ์— ๋Œ€ํ•œ ํ…Œ์ŠคํŠธ ์ž‘์„ฑ์ด ์–ธ์ œ ์ ํ•ฉํ•˜๋‹ค๊ณ  ์ƒ๊ฐํ•˜๋‚˜์š”?
์ €๋Š” ์ปดํฌ๋„ŒํŠธ์— ๋Œ€ํ•œ ๋น„์ฆˆ๋‹ˆ์Šค ๋กœ์ง์„ ๋‹ค ๊ตฌํ˜„ํ•œ ํ›„์— ์ง„ํ–‰ํ•˜๋Š” ๊ฒƒ์ด ์ ํ•ฉํ•˜๋‹ค๊ณ  ์ƒ๊ฐํ•ฉ๋‹ˆ๋‹ค!
์ด์œ ๋Š” ์•„๋ž˜์™€ ๊ฐ™์Šต๋‹ˆ๋‹ค

  • ๊ฐœ๋ฐœ์„ ํ•˜๋ฉด์„œ tdd๋ฅผ ํ• ๋งŒํผ ๊ฒ€์ฆํ•ด์•ผ ์˜ˆ์™ธ ์ผ€์ด์Šค๊ฐ€ ๋งŽ์ง€ ์•Š์„ ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค

Copy link
Collaborator

@seonghunYang seonghunYang Feb 26, 2024

Choose a reason for hiding this comment

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

ํ•ด๋‹น ๋ถ€๋ถ„์— ๋Œ€ํ•ด์„œ ์ €์˜ ์˜๊ฒฌ์„ ๋ง์”€๋“œ๋ฆฌ๋ฉด ํ…Œ์ŠคํŠธ๋Š” ๊ฐœ๋ฐœ๊ณผ ๋™์‹œ์— ์ด๋ค„์ ธ์•ผ ํ•œ๋‹ค๊ณ  ์ƒ๊ฐํ•ฉ๋‹ˆ๋‹ค. ์ด ๋ถ€๋ถ„์€ ํšŒ๊ณ  ์‹œ๊ฐ„์— ๋งˆ์ € ๋…ผ์˜ํ•˜๋„๋ก ํ•ฉ์‹œ๋‹ค!

yougyung
yougyung previously approved these changes Feb 24, 2024
Comment on lines 3 to 10
type lectureInfo = {
id: number;
year: string;
semester: string;
lectureCode: string;
lectureName: string;
credit: number;
};
Copy link
Member

Choose a reason for hiding this comment

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

๋‘ ๋ฒˆ ์ด์ƒ ์‚ฌ์šฉ๋˜๋Š” ๊ณตํ†ต๋œ ํƒ€์ž…์— ๋Œ€ํ•ด์„œ ํŒŒ์ผ๋กœ ๋ถ„๋ฆฌํ•˜๋Š” ๊ฒƒ์€ ์–ด๋–จ๊นŒ ์ œ์•ˆ๋“œ๋ ค์š” :)

Copy link
Member Author

Choose a reason for hiding this comment

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

lecture info ํƒ€์ž…์€ taken lecture์—์„œ ํ•œ ๋ฒˆ ์‚ฌ์šฉ๋˜๋Š”๋ฐ ๋‘ ๋ฒˆ ์ด์ƒ ์‚ฌ์šฉ๋œ๋‹ค๋Š” ๊ฒŒ ์–ด๋–ค ๋ง์”€์ด์‹ ์ง€ ์กฐ๊ธˆ ๋” ์•Œ๋ ค์ฃผ์‹ค ์ˆ˜ ์žˆ๋‚˜์š”1?

Copy link
Member

Choose a reason for hiding this comment

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

app/ui/taken-lectures/taken-lecture-list.tsx์—์„œ ์‚ฌ์šฉ๋˜๊ณ  ์žˆ๋Š”

const parseTakenLectures = (subjects: TakenLectures['takenLectures']) =>

๋ถ€๋ถ„์—์„œ ์ฐฉ๊ฐํ•œ ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค. ํ•ด๋‹น ๋ถ€๋ถ„์€ ๊ทธ๋Œ€๋กœ ์ง„ํ–‰ํ•ด๋„ ์ข‹์„ ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค. ์ฃ„์†กํ•ฉ๋‹ˆ๋‹ค :)

Copy link
Member

Choose a reason for hiding this comment

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

taken-lecture-title์ด๋ผ๋Š” ๋„ค์ด๋ฐ์ด ์ ์ ˆํ•˜์ง€์•Š๋‹ค๋Š” ์ƒ๊ฐ์ด ๋“ญ๋‹ˆ๋‹ค. ํ•ด๋‹น ์ปดํฌ๋„ŒํŠธ๊ฐ€ ๊ฒฐ๊ณผ ํŽ˜์ด์ง€์—์„œ๋„ ์žฌ์‚ฌ์šฉ๋  ๊ฒƒ์œผ๋กœ ์˜ˆ์ƒ๋˜๋Š”๋ฐ, ๊ธฐ์ด์ˆ˜๊ณผ๋ชฉ ๋ฟ๋งŒ์•„๋‹ˆ๋ผ ๋ฏธ์ด์ˆ˜๊ณผ๋ชฉ์„ ํ‘œ์‹œํ• ๋•Œ๋„ ํ•จ๊ป˜ ๋…ธ์ถœ๋˜๊ธฐ ๋•Œ๋ฌธ์ž…๋‹ˆ๋‹ค.

๊ฒฐ๊ณผํŽ˜์ด์ง€์—์„œ ํ•ด๋‹น ์ปดํฌ๋„ŒํŠธ๋ฅผ ์žฌ์‚ฌ์šฉํ•ด์„œ ๋…ธ์ถœํ•  ๊ฒƒ์œผ๋กœ ์˜ˆ์ƒ๋˜๋Š” (ํ˜„์žฌ ๋“ค์€ ํ•™์ /
๊ธฐ์ค€ ํ•™์ )์ •๋ณด๊ฐ€ ๋ฏธ์ด์ˆ˜ ๊ณผ๋ชฉ ํ‘œ์‹œ์—์„œ ์‚ฌ์šฉ๋˜๋Š” ๊ฒฝ์šฐ์—๋„ ๊ธฐ์ด์ˆ˜๋ฅผ ๊ธฐ์ค€์œผ๋กœ ๋…ธ์ถœ ํ•˜๊ณ  ์žˆ์ง€๋งŒ, ์ด๋Š” ๊ธฐ์ด์ˆ˜์— ๋Œ€ํ•œ title์ด ์•„๋‹ˆ๋ผ table์— ๋Œ€ํ•œ ์ •๋ณด๋ฅผ ๋…ธ์ถœํ•˜๋Š” ๊ฒƒ์ด๋ผ๊ณ  ์ƒ๊ฐํ•ฉ๋‹ˆ๋‹ค.

๋”ฐ๋ผ์„œ,

  1. table-info ๋„ค์ด๋ฐ์„ ๋ณ€๊ฒฝํ•˜๊ณ 
    • ๋ฐ˜๋“œ์‹œ ํ•ด๋‹น ์ด๋ฆ„์ผ ํ•„์š”๋Š” ์—†๊ณ , table์— ์˜์กดํ•œ ๋„ค์ด๋ฐ
  2. view์ปดํฌ๋„ŒํŠธ๋กœ ์œ„์น˜
    ์‹œํ‚ค๋Š”๊ฒƒ์ด ์ ์ ˆํ•˜๋‹ค๊ณ  ์ƒ๊ฐํ•ฉ๋‹ˆ๋‹ค.

Copy link
Member Author

Choose a reason for hiding this comment

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

๋ฏธ์ด์ˆ˜ ๊ณผ๋ชฉ ํ‘œ์‹œ์—๋„ ๋…ธ์ถœ๋˜๋Š” ๊ฑธ ์ƒ๊ฐํ•˜์ง€ ๋ชปํ–ˆ๋„ค์š”! taken lecture์—์„œ lecture๋กœ ๋ณ€๊ฒฝํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค!
table์— ์˜์กดํ•œ ๋„ค์ด๋ฐ์„ ๋ง์”€ํ•˜์…จ๋Š”๋ฐ ์•„๋ž˜ ๊ฐ™์€ ๊ฒฝ์šฐ์—๋„ taken-lecture-title ์ปดํฌ๋„ŒํŠธ๋Š” ์‚ฌ์šฉ๋  ์˜ˆ์ •์ž…๋‹ˆ๋‹ค!
table์— ์˜์กดํ•œ ๋„ค์ด๋ฐ์„ ๊ฐ€์ ธ๊ฐ€๊ธฐ์—” ์• ๋งคํ•˜๋‹ค๊ณ  ์ƒ๊ฐํ•˜๋Š”๋ฐ ํ˜น์‹œ ์–ด๋–ป๊ฒŒ ์ƒ๊ฐํ•˜์‹œ๋‚˜์š”!? ( ์ €๋ฒˆ์— ์นดํŽ˜์—์„œ ์ €ํฌ๋ผ๋ฆฌ ์–˜๊ธฐํ–ˆ๋˜ ๊ฑฐ,,,,,, ๊ธฐ์–ตํ•˜์‹œ๋‚˜์—ฌ??)
image

Copy link
Member

Choose a reason for hiding this comment

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

๋ชจํ˜ธํ•œ ๋ถ€๋ถ„์ด ์žˆ๋‹ค๋Š” ์˜๊ฒฌ์— ๋Œ€ํ•ด์„œ ๊ณต๊ฐํ•ฉ๋‹ˆ๋‹ค. table์—์„œ ์˜์กด์„ฑ์„ ๊ฐ€์ ธ๊ฐ€๊ธด ์–ด๋ ค์šธ ๊ฒƒ ๊ฐ™๋„ค์š”.

์ €๋ฒˆ์— ์นดํŽ˜์—์„œ ์ €ํฌ๋ผ๋ฆฌ ์–˜๊ธฐํ–ˆ๋˜ ๊ฑฐ,,,,,, ๊ธฐ์–ตํ•˜์‹œ๋‚˜์—ฌ??

์‹ฌ์‹ฌํ•œ ์‚ฌ๊ณผ์˜ ๋ง์”€...์„ ์ „ํ•˜๋ฉฐ, ์ •ํ™•ํ•œ ๋Œ€ํ™”์˜ ํ๋ฆ„์€ ๊ธฐ์–ต์ด ๋‚˜์ง€์•Š์ง€๋งŒ ๋‹น์‹œ์—๋„ ๋น„์Šทํ•œ ๋ฌธ์ œ๋กœ ์ด์•ผ๊ธฐ๋ฅผ ๋‚˜๋ˆด๋˜ ๊ฒƒ์œผ๋กœ ๊ธฐ์–ตํ•˜๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค. lecture-info ๋“ฑ ์—ฌ๋Ÿฌ ํ›„๋ณด๊ตฐ์ด ์žˆ์—ˆ๋˜ ๊ฒƒ์œผ๋กœ ๊ธฐ์–ตํ•˜๋Š”๋ฐ ํ•ด๋‹น ๋„ค์ด๋ฐ์€ ๋‚ด์ผ ํšŒ์˜๋•Œ ์ด์•ผ๊ธฐํ•ด๋ด๋„ ์ข‹์„ ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค !

Copy link

Copy link

Copy link

@gahyuun
Copy link
Member Author

gahyuun commented Feb 27, 2024

@seonghunYang @yougyung
๋ณ€๊ฒฝ ์‚ฌํ•ญ ๋ฐ˜์˜ํ•ด์„œ ํ‘ธ์‹œํ–ˆ์Šต๋‹ˆ๋‹ค! ํ™•์ธ ๋ถ€ํƒ๋“œ๋ฆฝ๋‹ˆ๋‹ค:)

  • taken lecture title domain component๋ฅผ label container๋ผ๋Š” view component๋กœ ๋ณ€๊ฒฝ
  • ๊ธฐ์ด์ˆ˜ ๊ณผ๋ชฉ ๋ฆฌ์ŠคํŠธ ํ…Œ์ŠคํŠธ ์ฝ”๋“œ ์ž‘์„ฑ
  • taken lecture ํด๋” ๋„ค์ด๋ฐ์„ lecture๋กœ ๋ณ€๊ฒฝ ( ๋ฏธ์ด์ˆ˜ ๊ณผ๋ชฉ์— ๋Œ€ํ•ด์„œ๋„ ํฌํ•จ๋  ๊ฒƒ ๊ฐ™๊ธฐ ๋•Œ๋ฌธ์ž…๋‹ˆ๋‹ค)

jest์—์„œ next js server component ๋ฅผ ์ง€์›ํ•˜์ง€ ์•Š๋Š” ๊ฒƒ ๊ฐ™๋”๋ผ๊ตฌ์š”
revenue chart test code์™€ ์•„๋ž˜ ๋งํฌ๋ฅผ ์ฐธ๊ณ ํ•ด์„œ ํ…Œ์ŠคํŠธ ์ฝ”๋“œ๋ฅผ ๊ตฌํ˜„ํ–ˆ์Šต๋‹ˆ๋‹ค
https://stackoverflow.com/questions/75729282/testing-an-async-server-component-with-jest-in-next-13

Copy link
Collaborator

@seonghunYang seonghunYang left a comment

Choose a reason for hiding this comment

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

  • ์ˆ˜๊ณ ํ•˜์…จ์Šต๋‹ˆ๋‹ค. comment ๋‚จ๊ฒผ์œผ๋‹ˆ ํ™•์ธ ๋ถ€ํƒ๋“œ๋ ค์š”.

@@ -0,0 +1,15 @@
import { fetchTakenLectures } from '@/app/business/lecture/taken-lecture-list.query';
import { Table } from '../view/molecule/table';
import TakenLectureTitle from './taken-lecture-title';
Copy link
Collaborator

Choose a reason for hiding this comment

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

[comment]

  • ํŒŒ์ผ์ด๋ž‘ ์ปดํฌ๋„ŒํŠธ ์ด๋ฆ„์ด TakenLectureLabel๋กœ ์•„์ง ๋ณ€๊ฒฝ๋˜์ง€ ์•Š๋Š” ๊ฒƒ ๊ฐ™๋„ค์š”!

Copy link
Member Author

Choose a reason for hiding this comment

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

์ˆ˜์ •ํ–ˆ์Šต๋‹ˆ๋‹ค! ์•Œ๋ ค์ฃผ์…”์„œ ๊ฐ์‚ฌํ•ฉ๋‹ˆ๋‹ค
rename: taken lecture title -> taken lecture label

describe('Taken lecture list', () => {
it('๊ธฐ์ด์ˆ˜ ๊ณผ๋ชฉ ๋ฆฌ์ŠคํŠธ๋ฅผ ๋ณด์—ฌ์ค€๋‹ค.', async () => {
render(await TakenLectureList());
expect(await screen.findByTestId('table-data'));
Copy link
Collaborator

Choose a reason for hiding this comment

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

[comment]

  • test-id๋กœ ํ…Œ์ŠคํŠธ ์ž‘์„ฑํ•˜์‹  ์ด์œ ๊ฐ€ ์žˆ์„๊นŒ์š”?

Copy link
Member Author

Choose a reason for hiding this comment

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

๊ธฐ์ด์ˆ˜ ๊ณผ๋ชฉ ๋ฆฌ์ŠคํŠธ๊ฐ€ ๋ฐ์ดํ„ฐ๋ฅผ ํ˜ธ์ถœํ•ด์„œ ์ž˜ ๋ Œ๋”๋ง ํ•˜๋Š” ์ง€ ํ™•์ธํ•ด์•ผ ํ–ˆ์Šต๋‹ˆ๋‹ค!
๋‹ค๋ฅธ ํ…Œ์ŠคํŠธ์ฒ˜๋Ÿผ findByText ๋ฅผ ์ด์šฉํ•˜๊ธฐ์—” ์–ด๋–ค ๋ฐ์ดํ„ฐ๊ฐ€ ๋“ค์–ด์˜ฌ ์ง€ ๋ชจ๋ฅด๊ธฐ ๋•Œ๋ฌธ์— test id๋ฅผ ์‚ฌ์šฉํ–ˆ์Šต๋‹ˆ๋‹ค!
๋ฐ์ดํ„ฐ๊ฐ€ ๋ฌธ์ œ ์—†์ด ํ˜ธ์ถœ๋˜๋ฉด table์ด ์ •์ƒ์ ์œผ๋กœ ๋ Œ๋”๋ง ๋  ๊ฒƒ์ด๋ผ๊ณ  ํŒ๋‹จํ–ˆ๊ธฐ ๋•Œ๋ฌธ์ž…๋‹ˆ๋‹ค~!

Copy link
Collaborator

Choose a reason for hiding this comment

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

  • ๋„ค, ๊ฐ์‚ฌํ•ฉ๋‹ˆ๋‹ค. ๋ง์”€ํ•˜์‹ ๋Œ€๋กœ test-id๊ฐ€ ์ ์ ˆํ•ด ๋ณด์ด๋„ค์š”!
  • ์•„๋ž˜๋Š” ํ…Œ์ŠคํŠธ์—์„œ ์š”์†Œ๋ฅผ ์„ ํƒํ•˜๋Š” ๋ฒ ์ŠคํŠธ ํ”„๋ž™ํ‹ฐ์Šค๋ฅผ ์ •๋ฆฌํ•œ ๋ฌธ์„œ์ž…๋‹ˆ๋‹ค. ์ฐธ๊ณ ํ•˜์‹œ๋ฉด ๋„์›€์ด ๋  ๊ฒƒ ๊ฐ™์•„ ๊ณต์œ ํ•ฉ๋‹ˆ๋‹ค
    https://docs.cypress.io/guides/references/best-practices#Selecting-Elements

Copy link

Copy link
Member

@yougyung yougyung left a comment

Choose a reason for hiding this comment

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

์ˆ˜์ •์‚ฌํ•ญ ํ™•์ธํ–ˆ์Šต๋‹ˆ๋‹ค. ์ˆ˜๊ณ ํ•˜์…จ์–ด์š” ๐Ÿ‘

@@ -0,0 +1,20 @@
import { API_PATH } from '../api-path';

type lectureInfo = {
Copy link
Member

Choose a reason for hiding this comment

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

์ปจ๋ฒค์…˜ ํ™•์ธ ๋ถ€ํƒ๋“œ๋ฆฝ๋‹ˆ๋‹ค :)

Copy link
Member Author

Choose a reason for hiding this comment

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

์ˆ˜์ •ํ–ˆ์Šต๋‹ˆ๋‹ค! ์•Œ๋ ค์ฃผ์…”์„œ ๊ฐ์‚ฌํ•ฉ๋‹ˆ๋‹ค:)
chore: modifying type name to Pascal Case

Copy link

Copy link
Collaborator

@seonghunYang seonghunYang left a comment

Choose a reason for hiding this comment

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

  • ์ˆ˜๊ณ ํ•˜์…จ์Šต๋‹ˆ๋‹ค.

describe('Taken lecture list', () => {
it('๊ธฐ์ด์ˆ˜ ๊ณผ๋ชฉ ๋ฆฌ์ŠคํŠธ๋ฅผ ๋ณด์—ฌ์ค€๋‹ค.', async () => {
render(await TakenLectureList());
expect(await screen.findByTestId('table-data'));
Copy link
Collaborator

Choose a reason for hiding this comment

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

  • ๋„ค, ๊ฐ์‚ฌํ•ฉ๋‹ˆ๋‹ค. ๋ง์”€ํ•˜์‹ ๋Œ€๋กœ test-id๊ฐ€ ์ ์ ˆํ•ด ๋ณด์ด๋„ค์š”!
  • ์•„๋ž˜๋Š” ํ…Œ์ŠคํŠธ์—์„œ ์š”์†Œ๋ฅผ ์„ ํƒํ•˜๋Š” ๋ฒ ์ŠคํŠธ ํ”„๋ž™ํ‹ฐ์Šค๋ฅผ ์ •๋ฆฌํ•œ ๋ฌธ์„œ์ž…๋‹ˆ๋‹ค. ์ฐธ๊ณ ํ•˜์‹œ๋ฉด ๋„์›€์ด ๋  ๊ฒƒ ๊ฐ™์•„ ๊ณต์œ ํ•ฉ๋‹ˆ๋‹ค
    https://docs.cypress.io/guides/references/best-practices#Selecting-Elements

@gahyuun gahyuun merged commit 9d90007 into main Feb 29, 2024
3 checks passed
@gahyuun gahyuun deleted the completed-subjects-api/#35 branch February 29, 2024 13:35
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.

3 participants