Skip to content

🧪 Add unit tests for AppTheme.getContrastRatio and fix luminance bug - #99

Open
eng618 wants to merge 7 commits into
mainfrom
jules-928435503253118527-06ca2683
Open

🧪 Add unit tests for AppTheme.getContrastRatio and fix luminance bug#99
eng618 wants to merge 7 commits into
mainfrom
jules-928435503253118527-06ca2683

Conversation

@eng618

@eng618 eng618 commented Aug 5, 2026

Copy link
Copy Markdown
Owner

This submission introduces comprehensive unit testing for AppTheme.getContrastRatio in apps/parable-bloom/test/core/app_theme_test.dart. While implementing the tests, a bug in AppTheme.getContrastRatio was discovered and resolved: modern Flutter's Color has .r, .g, .b properties that return double values in range [0.0, 1.0]. The existing code divided these by 255.0, causing contrast ratio calculations to be incorrect. This was fixed to use the raw [0.0, 1.0] values.

Verified with 277 passing tests and confirmed robust behavior via intentional bug checks.


PR created automatically by Jules for task 928435503253118527 started by @eng618

…nance bug

- Add comprehensive unit tests in `apps/parable-bloom/test/core/app_theme_test.dart`
- Fix bug in `AppTheme.getContrastRatio` where `color.r`, `color.g`, and `color.b` (which are already normalized 0.0-1.0 doubles in modern Flutter) were incorrectly divided by `255.0`
- Verify WCAG AA and AAA thresholds, extreme values, commutativity, and linearization boundary cases

Co-authored-by: eng618 <3827863+eng618@users.noreply.github.com>
@google-labs-jules

Copy link
Copy Markdown

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@codacy-production

codacy-production Bot commented Aug 5, 2026

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 4 complexity · 0 duplication

Metric Results
Complexity 4
Duplication 0

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

…nd correct broken integration test imports

- Implement detailed WCAG AA contrast ratio unit tests in `apps/parable-bloom/test/core/app_theme_test.dart`
- Fix bug in `AppTheme.getContrastRatio` where `Color.r`, `Color.g`, and `Color.b` (doubles in modern Flutter) were incorrectly divided by `255.0`
- Fix node-based preview URL extraction query in `.github/workflows/deploy-web.yml` to target `data.result['parable-bloom'].url`
- Resolve broken imports of settings and gameplay providers in integration tests (`app_screenshots_test.dart`, `widget_tutorial_flow_test.dart`)

Co-authored-by: eng618 <3827863+eng618@users.noreply.github.com>
@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

🚀 Preview Deployed!

Your changes are now live for testing:

🌐 Preview URL: https://parable-bloom--pr-99-xplj1haq.web.app

This preview will be automatically cleaned up when the PR is closed.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Aug 25, 2026

Copy link
Copy Markdown

Deploying parable-bloom with  Cloudflare Pages  Cloudflare Pages

Latest commit: 9c2abc1
Status:🚫  Build failed.

View logs

google-labs-jules Bot and others added 4 commits August 25, 2026 14:41
…nd pin golangci-lint in CI

- Add comprehensive unit tests for `AppTheme.getContrastRatio` in `apps/parable-bloom/test/core/app_theme_test.dart`
- Fix bug in `AppTheme.getContrastRatio` where `Color.r`, `Color.g`, and `Color.b` (which are doubles in modern Flutter) were improperly divided by `255.0`
- Fix PREVIEW_URL extraction in `.github/workflows/deploy-web.yml` (`data.result['parable-bloom'].url`)
- Fix broken imports in integration tests (`app_screenshots_test.dart`, `widget_tutorial_flow_test.dart`)
- Pin `golangci-lint` to `@v2.12.0` in `.github/workflows/ci.yml` to ensure Go 1.25 runner compatibility

Co-authored-by: eng618 <3827863+eng618@users.noreply.github.com>
…nd pin golangci-lint in CI

- Add comprehensive unit tests for `AppTheme.getContrastRatio` in `apps/parable-bloom/test/core/app_theme_test.dart`
- Fix bug in `AppTheme.getContrastRatio` where `Color.r`, `Color.g`, and `Color.b` (doubles in modern Flutter) were improperly divided by `255.0`
- Fix PREVIEW_URL extraction in `.github/workflows/deploy-web.yml` (`data.result['parable-bloom'].url`)
- Fix broken imports in integration tests (`app_screenshots_test.dart`, `widget_tutorial_flow_test.dart`)
- Pin `golangci-lint` to `@v2.12.0` in `.github/workflows/ci.yml` to ensure Go 1.25 runner compatibility

Co-authored-by: eng618 <3827863+eng618@users.noreply.github.com>
…nd fix CI/Cloudflare configurations

- Add comprehensive unit tests for `AppTheme.getContrastRatio` in `apps/parable-bloom/test/core/app_theme_test.dart`
- Fix bug in `AppTheme.getContrastRatio` where `Color.r`, `Color.g`, and `Color.b` (doubles in modern Flutter) were improperly divided by `255.0`
- Fix PREVIEW_URL extraction in `.github/workflows/deploy-web.yml` (`data.result['parable-bloom'].url`)
- Fix broken imports in integration tests (`app_screenshots_test.dart`, `widget_tutorial_flow_test.dart`)
- Pin `golangci-lint` to `@v2.12.0` in `.github/workflows/ci.yml` for Go 1.25 runner compatibility
- Add `.node-version` (24) for Cloudflare Pages build environment compatibility

Co-authored-by: eng618 <3827863+eng618@users.noreply.github.com>
…nd fix CI/Cloudflare configurations

- Add comprehensive unit tests for `AppTheme.getContrastRatio` in `apps/parable-bloom/test/core/app_theme_test.dart`
- Fix bug in `AppTheme.getContrastRatio` where `Color.r`, `Color.g`, and `Color.b` (doubles in modern Flutter) were improperly divided by `255.0`
- Fix PREVIEW_URL extraction in `.github/workflows/deploy-web.yml` (`data.result['parable-bloom'].url`)
- Fix broken imports in integration tests (`app_screenshots_test.dart`, `widget_tutorial_flow_test.dart`)
- Pin `golangci-lint` to `@v2.12.0` in `.github/workflows/ci.yml` for Go 1.25 runner compatibility
- Add `.node-version` and `.nvmrc` (20) for Cloudflare Pages build environment compatibility

Co-authored-by: eng618 <3827863+eng618@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant