Skip to content

Rename noChildren to hasChildren for clarity - #599

Open
gioalex07 wants to merge 6 commits into
VREMSoftwareDevelopment:mainfrom
gioalex07:fix/rename-nochildren-to-haschildren
Open

Rename noChildren to hasChildren for clarity#599
gioalex07 wants to merge 6 commits into
VREMSoftwareDevelopment:mainfrom
gioalex07:fix/rename-nochildren-to-haschildren

Conversation

@gioalex07

Copy link
Copy Markdown

The property noChildren returned true when children were present, which was semantically misleading. Renamed to hasChildren to match the actual behavior and avoid confusion for future contributors.

Summary

  • Rename WiFiDetail.noChildren to hasChildren for semantic clarity.
  • The property name was misleading: noChildren returned true when children were present.

What does this implement/fix?

  • Renamed property in WiFiDetail.kt
  • Updated consumer in AccessPointsAdapterGroup.kt (2 call sites)
  • Updated test names and assertions in WiFiDetailTest.kt and AccessPointsAdapterGroupTest.kt

Does this close any issues?

  • N/A (naming/clarity improvement)

How was this tested?

  • Platform: WSL2 / AlmaLinux 9
  • Build variant: debug
  • Commands run:
./gradlew ktlintCheck → BUILD SUCCESSFUL
./gradlew testDebugUnitTest → BUILD SUCCESSFUL

gioalex07and others added 2 commits April 2, 2026 18:02
The property noChildren returned true when children were present,
which was semantically misleading. Renamed to hasChildren to match
the actual behavior and avoid confusion for future contributors.
@VREMSoftwareDevelopment

Copy link
Copy Markdown
Owner

Thanks for the contribution.

  1. AI Usage Disclosure
    Disclose any AI tool involvement and use the “AI assistance used” label.

  2. Testing Requirements
    Changes must be tested on a real Android device.
    Emulator‑only testing or running build tasks (e.g., ktlintCheck, unit tests, successful Gradle build) is not sufficient.
    UI/UX behavior, layouts, gestures, and rendering often differ between emulators and actual devices.

Please update the PR with real‑device testing details so review can continue.

@codecov

codecovBot commented Apr 4, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.83%. Comparing base (727346e) to head (9a52d4d).

Additional details and impacted files
@@ Coverage Diff @@## main #599 +/- ##
=========================================
Coverage 97.83% 97.83% Complexity 975 975 =========================================
Files 121 121 Lines 2581 2581 Branches 211 211 =========================================
Hits 2525 2525 Misses 19 19 Partials 37 37 
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@VREMSoftwareDevelopmentVREMSoftwareDevelopment added the AI assistance used Indicates that an AI assistant was used to generate this PR label Apr 4, 2026

CopilotAI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Renames a misleading WiFiDetail boolean property so its name matches its behavior, and updates affected production/test call sites accordingly.

Changes:

  • Renamed WiFiDetail.noChildrenWiFiDetail.hasChildren.
  • Updated AccessPointsAdapterGroup to use the new property name.
  • Updated unit tests to reference hasChildren (assertions and some test names).

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

FileDescription
app/src/main/kotlin/com/vrem/wifianalyzer/wifi/model/WiFiDetail.ktRenames the boolean property to hasChildren while keeping the same underlying logic.
app/src/main/kotlin/com/vrem/wifianalyzer/wifi/accesspoint/AccessPointsAdapterGroup.ktUpdates the two call sites to use hasChildren.
app/src/test/kotlin/com/vrem/wifianalyzer/wifi/model/WiFiDetailTest.ktUpdates test names and assertions to validate hasChildren.
app/src/test/kotlin/com/vrem/wifianalyzer/wifi/accesspoint/AccessPointsAdapterGroupTest.ktUpdates mocking/verification to use hasChildren (but leaves some test names semantically inconsistent with the stubbed values).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 246 to +257
fun onGroupCollapsedDoesNotRemoveIfHasChildren() {
// setup
doReturn(GroupBy.SSID).whenever(settings).groupBy()
fixture.updateGroupBy()
doReturn(false).whenever(wiFiDetailWithChildren).noChildren
doReturn(false).whenever(wiFiDetailWithChildren).hasChildren
val wiFiDetails = listOf(wiFiDetailWithChildren)
fixture.expanded.add("test")
// execute
fixture.onGroupCollapsed(wiFiDetails, 0)
// validate
assertThat(fixture.expanded).contains("test")
verify(wiFiDetailWithChildren).noChildren
verify(wiFiDetailWithChildren).hasChildren

CopilotAIApr 25, 2026

Copy link

Choose a reason for hiding this comment

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

The test name says "DoesNotRemoveIfHasChildren", but this test stubs hasChildren to false and asserts the expanded set is unchanged. Rename the test to match the behavior being exercised (e.g., "...IfNoChildren"), or change the stub/assertions to actually cover the hasChildren == true path implied by the current name.

Copilot uses AI. Check for mistakes.
Comment on lines 260 to +271
@Test
fun onGroupExpandedDoesNotAddIfHasChildren() {
// setup
doReturn(GroupBy.SSID).whenever(settings).groupBy()
fixture.updateGroupBy()
doReturn(false).whenever(wiFiDetailWithChildren).noChildren
doReturn(false).whenever(wiFiDetailWithChildren).hasChildren
val wiFiDetails = listOf(wiFiDetailWithChildren)
// execute
fixture.onGroupExpanded(wiFiDetails, 0)
// validate
assertThat(fixture.expanded).isEmpty()
verify(wiFiDetailWithChildren).noChildren
verify(wiFiDetailWithChildren).hasChildren

CopilotAIApr 25, 2026

Copy link

Choose a reason for hiding this comment

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

The test name says "DoesNotAddIfHasChildren", but it stubs hasChildren to false and expects no change. Update the test name to reflect the hasChildren == false scenario, or adjust the setup/expectation so the name and behavior align.

Copilot uses AI. Check for mistakes.
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI assistance usedIndicates that an AI assistant was used to generate this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@gioalex07@VREMSoftwareDevelopment