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

Showing Course rather than Courses (or program/s) when there is only 1 to display #2139

Merged
merged 3 commits into from
Mar 27, 2024

Conversation

JenniWhitman
Copy link
Contributor

What are the relevant tickets?

Closes https://github.com/mitodl/hq/issues/2488

Description (What does it do?)

Adds a function to render the correct display text on the desktop view for 1 course or program as opposed to multiple (without an s to make the noun plural).

How can this be tested?

Create a department that only has one course and/or one program assigned. You should see the text change from 1 courses (in current main branch) to 1 course when you select that department on the catalog page.

@@ -561,6 +561,20 @@ export class CatalogPage extends React.Component<Props> {
} else return 0
}

renderCatalogCount() {
Copy link
Contributor

Choose a reason for hiding this comment

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

I would just add a description above this method describing what it does.

@@ -882,4 +882,36 @@ describe("CatalogPage", function() {
JSON.stringify([displayedProgram, newProgram])
)
})

it("renderCatalogCount is plural for more than one course", async () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice tests!

@JenniWhitman JenniWhitman merged commit ef7a1a1 into main Mar 27, 2024
3 checks passed
This was referenced Mar 27, 2024
@JenniWhitman JenniWhitman deleted the jw/display-course-not-courses branch May 14, 2024 17:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants