Skip to content

Manchester | 26-ITP-May | Yee Man Tsang | Sprint 3 | 1-implement-and-rewrite-tests - #1496

Open
lintsang wants to merge 3 commits into
CodeYourFuture:mainfrom
lintsang:coursework/sprint-3-implement-and-rewrite
Open

Manchester | 26-ITP-May | Yee Man Tsang | Sprint 3 | 1-implement-and-rewrite-tests#1496
lintsang wants to merge 3 commits into
CodeYourFuture:mainfrom
lintsang:coursework/sprint-3-implement-and-rewrite

Conversation

@lintsang

@lintsang lintsang commented Jul 11, 2026

Copy link
Copy Markdown

Learners, PR Template

Self checklist

  • I have titled my PR with Region | Cohort | FirstName LastName | Sprint | Assignment Title
  • My changes meet the requirements of the task
  • I have tested my changes
  • My changes follow the style guide

Changelist

I followed the readme.md and finished the 1-implement-and-rewrite-tests folder

@github-actions

This comment has been minimized.

@lintsang lintsang added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Jul 11, 2026
@github-actions

This comment has been minimized.

@github-actions github-actions Bot removed the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Jul 11, 2026
@lintsang lintsang added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Jul 11, 2026
@Liam310 Liam310 added Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Jul 14, 2026
Comment thread Sprint-3/1-implement-and-rewrite-tests/implement/1-get-angle-type.js Outdated
Comment thread Sprint-3/1-implement-and-rewrite-tests/implement/2-is-proper-fraction.js Outdated
Comment thread Sprint-3/1-implement-and-rewrite-tests/implement/3-get-card-value.js Outdated
console.log("Error thrown for invalid card 🎉");
}

// What other invalid card cases can you think of?

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Like the comment says - what other invalid card cases can you think?

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Hint: Think of an input that has the right format but isn't valid!

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I tried to think about anything I may miss and think maybe if the input is a number instead if string. Hope this is what you are asking to check

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

It's good to consider these cases - but it's not exactly what I had in mind.

When I say in the right format, I mean "a number followed by a suit". So "4♦" is in the right format and is a totally valid input! But what about "16♦"? That's "a number followed by a suit", but is it valid?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Got it. This is included in the testing case now. Thanks

@Liam310 Liam310 added Reviewed Volunteer to add when completing a review with trainee action still to take. and removed Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. labels Jul 14, 2026
@lintsang lintsang added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Jul 24, 2026
Comment on lines +35 to +42
// test(`Should return invalid as the case is not valid`, () => {
// expect(getCardValue("invalid")).toEqual("invalid");
// expect(getCardValue("♦")).toEqual("invalid");
// expect(getCardValue("4")).toEqual("invalid");
// expect(getCardValue("")).toEqual("invalid");
// expect(getCardValue("m")).toEqual("invalid");
// expect(getCardValue("300")).toEqual("invalid");
// });

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Don't leave commented out code - if it's not relevant any more, it can be removed 🙂

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Sorry, cleaned it

Comment on lines 29 to 43
@@ -45,11 +42,11 @@ function getCardValue(card) {
case "9":
return Number(number);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

sorry I missed this earlier... what about something like "10♥"? Is that valid or invalid? How would it be handled by your function?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Yes, you are right. I have missed the card 10.

@Liam310

Liam310 commented Jul 28, 2026

Copy link
Copy Markdown

Great work @lintsang! Just one comment I don't think you quite resolved and I've left a couple of other small ones. Almost there now 🙂

@lintsang

Copy link
Copy Markdown
Author

Many thanks to your feedback Liam

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. Reviewed Volunteer to add when completing a review with trainee action still to take.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants