Skip to content

London | 26-ITP-Jan | Maryanne Mosonik | Sprint 2 | Module Data Groups#1101

Closed
Maryanne-K wants to merge 21 commits into
CodeYourFuture:mainfrom
Maryanne-K:Sprint_2
Closed

London | 26-ITP-Jan | Maryanne Mosonik | Sprint 2 | Module Data Groups#1101
Maryanne-K wants to merge 21 commits into
CodeYourFuture:mainfrom
Maryanne-K:Sprint_2

Conversation

@Maryanne-K
Copy link
Copy Markdown

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

Corrected and completed the implementations and jest test cases.

@github-actions

This comment has been minimized.

@Maryanne-K Maryanne-K closed this Mar 25, 2026
@Maryanne-K Maryanne-K reopened this Mar 25, 2026
@github-actions

This comment has been minimized.

@Maryanne-K Maryanne-K closed this Mar 25, 2026
@Maryanne-K Maryanne-K reopened this Mar 25, 2026
@github-actions

This comment has been minimized.

@Maryanne-K Maryanne-K closed this Mar 25, 2026
@Maryanne-K Maryanne-K reopened this Mar 25, 2026
@Maryanne-K Maryanne-K marked this pull request as ready for review March 25, 2026 23:43
@Maryanne-K Maryanne-K added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Mar 25, 2026
Copy link
Copy Markdown
Contributor

@cjyuan cjyuan left a comment

Choose a reason for hiding this comment

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

test.todo(" ... ") is just a placeholder to serve as a reminder for "what needs to be done".
In this exercise, that means "implementing the corresponding Jest tests described in the comments."

Can you replace them (in all .test.js files) with actual Jest tests?

Comment thread Sprint-2/debug/recipe.js Outdated
Comment thread Sprint-2/implement/contains.js Outdated
Comment thread Sprint-2/implement/querystring.js
Comment thread Sprint-2/implement/tally.js Outdated
@cjyuan cjyuan added Reviewed Volunteer to add when completing a review with trainee action still to take. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Mar 26, 2026
@Maryanne-K Maryanne-K added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Mar 30, 2026
@cjyuan
Copy link
Copy Markdown
Contributor

cjyuan commented Mar 30, 2026

Can you also address this comment (about implementing the Jest test in .test.js files):
#1101 (review)

The other changes are good.

@cjyuan cjyuan removed the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Mar 30, 2026
@Maryanne-K
Copy link
Copy Markdown
Author

Can you also address this comment (about implementing the Jest test in .test.js files): #1101 (review)

The other changes are good.

Hey CJ, replaced all the test todo in the files. Kindly check, thank you.

@Maryanne-K Maryanne-K added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Apr 2, 2026
Comment thread Sprint-2/implement/contains.test.js Outdated
Comment thread Sprint-2/implement/contains.test.js Outdated
@cjyuan cjyuan removed the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Apr 2, 2026
@Maryanne-K Maryanne-K added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Apr 16, 2026
Copy link
Copy Markdown
Contributor

@cjyuan cjyuan left a comment

Choose a reason for hiding this comment

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

Other changes are good. I will mark this PR as complete first.

// When passed to contains
// Then it should return false or throw an error
test("contains with invalid input returns false", () => {
expect(contains([], 'a')).toBe(false);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Your function is correct, but we should prepare the tests not only to verify our current implementation, but also to ensure that future changes do not alter the function's expected behavior.

This test expect(contains([], 'a')).toBe(false) cannot confirm that the function correctly returns false when the first argument is an array. This is because contains([], "a")could also returnfalse` simply because "a" is not a key of the array.

Arrays are objects, with their indices acting as keys. A proper test should use a non-empty array along with a valid key to ensure the function returns false specifically because the input is an array, not because the key is missing.

Note: Strings are not objects but their indices also act as their keys.

@cjyuan cjyuan added Complete Volunteer to add when work is complete and all review comments have been addressed. and removed 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. labels Apr 17, 2026
@illicitonion
Copy link
Copy Markdown
Member

Closing PR because the January ITP run has finished. Feel free to re-open if you're still working on it.

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

Labels

Complete Volunteer to add when work is complete and all review comments have been addressed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants