Skip to content

London | 26-ITP-May | Chinwe Chukwuma | Sprint 2 | Module-Data-Groups - #1353

Open
ChinweP wants to merge 15 commits into
CodeYourFuture:mainfrom
ChinweP:sprint-2-clean
Open

London | 26-ITP-May | Chinwe Chukwuma | Sprint 2 | Module-Data-Groups#1353
ChinweP wants to merge 15 commits into
CodeYourFuture:mainfrom
ChinweP:sprint-2-clean

Conversation

@ChinweP

@ChinweP ChinweP commented Jul 31, 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

Sprint 2 completed

@ChinweP ChinweP added Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. Module-Data-Groups The name of the module. labels Jul 31, 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 31, 2026
@github-actions

This comment has been minimized.

1 similar comment
@github-actions

This comment has been minimized.

@ChinweP ChinweP changed the title London | 26-ITP-May | Chinwe | Sprint 2 | Module-Data-Groups London | 26-ITP-May | Chinwe Chukwuma | Sprint 2 | Module-Data-Groups Jul 31, 2026
@github-actions

This comment has been minimized.

@ChinweP ChinweP added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Aug 1, 2026
@cjyuan

cjyuan commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

There is another Sprint-2 folder inside the Sprint-2 folder. I am not sure which set of files are the ones to be reviewed. Could you update this PR branch accordingly?

@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 Aug 6, 2026
@ChinweP ChinweP added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Aug 7, 2026
@ChinweP

ChinweP commented Aug 7, 2026

Copy link
Copy Markdown
Author

@cjyuan, apologies for the inconvenience. I've removed the unnecessary Sprint-2.

@cjyuan cjyuan left a comment

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.

You missed updating a few files in the implement sub-folder.

Comment thread Sprint-2/implement/contains.test.js Outdated
Comment on lines +38 to +52
// Given an object with properties
// When passed to contains with an existing property name
// Then it should return true
test("returns true when object contains the property", () => {
const obj = { a: 1, b: 2 };
expect(contains(obj, "a")).toBe(true);
});

// Given an object with properties
// When passed to contains with a non-existent property name
// Then it should return false
test("returns false when object does not contain the property", () => {
const obj = { a: 1, b: 2 };
expect(contains(obj, "c")).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.

How are these two tests different from the tests on lines 19-28?

Comment thread Sprint-2/implement/contains.test.js Outdated
// When passed to contains
// Then it should return false or throw an error
test("returns false for invalid parameters like an array", () => {
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.

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.

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 have removed the duplicate tests and changed the array test to use a non-empty array with a valid key.

@cjyuan cjyuan removed the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Aug 7, 2026
@ChinweP ChinweP added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Aug 10, 2026

@cjyuan cjyuan left a comment

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.

Changes look good.

Could you also update the remaining files in the implement subfolder?

Comment thread Sprint-2/implement/contains.test.js Outdated
expect(contains(arr, "0")).toBe(false);
expect(contains(null, "a")).toBe(false);
expect(contains(123, "a")).toBe(false);
expect(contains("hello", "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.

Note: Object.hasOwn("ABC", "0") is true (similar to array, indices are also considered properties of a string).

@cjyuan cjyuan removed the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Aug 10, 2026
@ChinweP

ChinweP commented Aug 11, 2026

Copy link
Copy Markdown
Author

I've now updated the invalid parameter test. Thanks for pointing this out.

@ChinweP ChinweP added 📅 Sprint 2 Assigned during Sprint 2 of this module Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. and removed Reviewed Volunteer to add when completing a review with trainee action still to take. labels Aug 11, 2026
@ChinweP
ChinweP requested a review from cjyuan August 11, 2026 00:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Module-Data-Groups The name of the module. Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. 📅 Sprint 2 Assigned during Sprint 2 of this module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants