Skip to content

test: run Settings Compose test with Hilt activity - #350

Merged
SayanthRock merged 1 commit into
mainfrom
fix/settings-compose-test-hilt-owner
Oct 22, 2026
Merged

SayanthRock merged 1 commit into
mainfrom
fix/settings-compose-test-hilt-owner

Conversation

@SayanthRock

@SayanthRock SayanthRock commented Oct 22, 2026 •

Copy link
Copy Markdown
Member

User description

Summary

  • Replace the standalone Compose test rule with createAndroidComposeRule<MainActivity>() so the test is hosted by the app's @AndroidEntryPoint activity.
  • This addresses a likely Hilt ViewModel test-host mismatch: GitHubSettingsScreen resolves AppearanceViewModel through hiltViewModel().

Verification

  • Source change committed to this branch.
  • Android build and instrumentation test have not been run in this environment.
  • This is a test-host correction, not proof that the user's device Settings crash is fixed. The runtime crash still needs a stack trace and successful device/CI verification.

CodeAnt-AI Description

Run settings screen tests in the app's Hilt activity

What Changed

  • The settings screen test now runs inside the app's activity, so it uses the Hilt setup required by the screen.

Impact

✅ Tests settings with the app's Hilt setup
✅ Catches ViewModel hosting issues in settings tests

💡 Usage Guide

Checking Your Pull Request

Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.

Talking to CodeAnt AI

Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:

@codeant-ai ask: Your question here

This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.

Example

@codeant-ai ask: Can you suggest a safer alternative to storing this secret?

Preserve Org Learnings with CodeAnt

You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:

@codeant-ai: Your feedback here

This helps CodeAnt AI learn and adapt to your team's coding style and standards.

Example

@codeant-ai: Do not flag unused imports.

Retrigger review

Ask CodeAnt AI to review the PR again, by typing:

@codeant-ai: review

Check Your Repository Health

To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.

@bolt-new-by-stackblitz

Copy link
Copy Markdown

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@ai-coding-guardrails

Copy link
Copy Markdown

I couldn't review this because this account isn't linked to a Zenable user yet. If this is your PR, link your account under Settings > User Management and re-request the review with a /zenable comment.

More detail

@coderabbitai

coderabbitai Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 57c50723-5cfe-46dd-9e2f-2f057f8cc823
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@SayanthRock
SayanthRock marked this pull request as ready for review October 22, 2026 15:52
Copilot AI lite review requested due to automatic review settings October 22, 2026 15:52
@ai-coding-guardrails

Copy link
Copy Markdown

I couldn't review this because this account isn't linked to a Zenable user yet. If this is your PR, link your account under Settings > User Management and re-request the review with a /zenable comment.

More detail

@strix-security

Copy link
Copy Markdown

Strix is installed on this repository, but we couldn't run this PR security review because this workspace's trial has ended. Add a card to resume code reviews here.

So far, Strix has reviewed 24 pull requests, surfaced 8 security issues (2 critical/high) and blocked 3 risky merges across this workspace.

@codeant-ai

codeant-ai Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

🤖 CodeAnt AI — Review Status

Status Commit Started (UTC) Finished (UTC)
✅ Reviewed your PR ef08532 Oct 22, 2026 · 15:52 15:54

@codeant-ai

codeant-ai Bot commented Oct 22, 2026

Copy link
Copy Markdown

Thanks for using CodeAnt! 🎉

We're free for open-source projects. if you're enjoying it, help us grow by sharing.

Share on X ·
Reddit ·
LinkedIn

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-22T15:53:21.120416Z ef08532 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@SayanthRock
SayanthRock merged commit 7864408 into main Oct 22, 2026
9 of 10 checks passed
@codeant-ai codeant-ai Bot added the size:XS This PR changes 0-9 lines, ignoring generated files label Oct 22, 2026

Copilot AI 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.

🟢 Approval recommended

The only identified issue is a non-blocking import-order nit, and all reviewers assessed the pull request as ready.

No open issues 🎉

What changed in this PR

Updates the Settings Compose instrumentation test to run within the app’s Hilt-enabled MainActivity, allowing hiltViewModel() dependencies to resolve correctly.

Changes:

  • Replaces createComposeRule() with createAndroidComposeRule<MainActivity>().
  • Updates the Compose test rule import.
  • Preserves the existing Settings assertions and interactions.
  • Import ordering should be aligned with the repository convention.
File Summary
app/​src/​androidTest/​java/​com/​sayanthrock/​githubrock/​GitHubSettingsScreenTest.kt Hosts the Settings Compose test in the Hilt-enabled MainActivity; contains a non-blocking import-order nit.

Review effort: Lite

@codeant-ai

codeant-ai Bot commented Oct 22, 2026

Copy link
Copy Markdown

CodeAnt Nitpicks

1 code suggestion

1. Launching MainActivity composes GitHubRockRoot, whose MainViewModel reconnects saved sessions and requests dashboard data, causing live network calls during this test on authenticated devices.

Possible bug · app/src/androidTest/java/com/sayanthrock/githubrock/GitHubSettingsScreenTest.kt:16

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

Labels

size:XS This PR changes 0-9 lines, ignoring generated files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants