"All new business logic should have corresponding unit tests."
Description
This PR adds unit tests for the new business logic introduced in the code diff of "src/pages/[course_name]/index.tsx". The goal is to ensure the correctness and maintainability of the new logic. The unit tests cover different scenarios, such as when the course metadata is loaded or not, when the user is signed in or not, and when the course is private or not.
Summary of Changes
Created a new unit test file named "[course_name]/index.test.tsx" in the same directory as the original file.
Modified the "index.test.tsx" file to write unit tests for the new business logic introduced in "index.tsx".
Updated the code in "index.tsx" to make it more testable and improve test coverage.
Please review and merge this PR to ensure the correctness and maintainability of the new business logic.
PR Feedback (click)
I created this PR to address this rule:
"All new business logic should have corresponding unit tests."
Description
This PR adds unit tests for the new business logic introduced in the code diff of "src/pages/[course_name]/index.tsx". The goal is to ensure the correctness and maintainability of the new logic. The unit tests cover different scenarios, such as when the course metadata is loaded or not, when the user is signed in or not, and when the course is private or not.
Summary of Changes
Please review and merge this PR to ensure the correctness and maintainability of the new business logic.