fix(system-theme): adiciona suporte ao tema claro#371
Conversation
|
lgtm |
📝 WalkthroughWalkthroughRemoves the hardcoded Possibly related PRs
Suggested labels
Suggested reviewers
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. 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. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (3)
app-modules/portal/tests/Feature/SocialLinksPageTest.php (2)
74-74: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winScope the
text-whitenegative assertion.Line 74 (
not->toContain('text-white')) is page-global and can fail from unrelated components. Limit this check to the social-links block/anchor classes under test.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@app-modules/portal/tests/Feature/SocialLinksPageTest.php` at line 74, The assertion on line 74 checks that 'text-white' does not appear anywhere on the entire page, which is too broad and can fail due to unrelated components. Instead of asserting against the full $html, scope the check to only the social-links block or container element being tested. Extract or identify the relevant portion of the HTML (such as the social-links div or anchor elements) and apply the not->toContain('text-white') assertion only to that scoped section to ensure the test only validates the social-links component under test.
49-50: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAvoid full inline-style string matching.
Lines 49-50 depend on exact whitespace/order in
style="". Assert tokens independently (--accent-light: #...and--accent-dark: #...) to prevent fragile failures.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@app-modules/portal/tests/Feature/SocialLinksPageTest.php` around lines 49 - 50, The test assertions in SocialLinksPageTest.php at lines 49-50 are checking for exact inline style strings which makes the test brittle to whitespace or property order changes. Instead of using toContain to match the full style string '--accent-light: `#0F172A`; --accent-dark: `#FFFFFF`;', split these assertions to independently verify that the HTML contains the individual CSS custom property tokens (--accent-light: `#0F172A` and --accent-dark: `#FFFFFF` separately) so the test only fails if the actual CSS values change, not the formatting.app-modules/portal/tests/Feature/HomepageTest.php (1)
27-27: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winHarden the dark-class assertion on
<html>.Line 27 checks one exact HTML string and can pass even if
darkis still present with different attribute ordering/class composition. Assert absence ofdarkon the<html>tag via a scoped regex/DOM parse instead of exact serialization.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@app-modules/portal/tests/Feature/HomepageTest.php` at line 27, The assertion in HomepageTest.php currently checks for an exact HTML string match using toContain() which is fragile and will fail to catch the dark class if attributes are reordered or classes are combined differently. Replace the exact string check with a more robust regex pattern that matches the html tag opening regardless of attribute order, or alternatively parse the HTML using DOM methods to specifically assert that the html element does not contain the dark class. This will ensure the assertion reliably verifies the absence of the dark class on the html tag regardless of how the HTML is formatted or what other classes or attributes are present.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@app-modules/portal/tests/Feature/HomepageTest.php`:
- Line 27: The assertion in HomepageTest.php currently checks for an exact HTML
string match using toContain() which is fragile and will fail to catch the dark
class if attributes are reordered or classes are combined differently. Replace
the exact string check with a more robust regex pattern that matches the html
tag opening regardless of attribute order, or alternatively parse the HTML using
DOM methods to specifically assert that the html element does not contain the
dark class. This will ensure the assertion reliably verifies the absence of the
dark class on the html tag regardless of how the HTML is formatted or what other
classes or attributes are present.
In `@app-modules/portal/tests/Feature/SocialLinksPageTest.php`:
- Line 74: The assertion on line 74 checks that 'text-white' does not appear
anywhere on the entire page, which is too broad and can fail due to unrelated
components. Instead of asserting against the full $html, scope the check to only
the social-links block or container element being tested. Extract or identify
the relevant portion of the HTML (such as the social-links div or anchor
elements) and apply the not->toContain('text-white') assertion only to that
scoped section to ensure the test only validates the social-links component
under test.
- Around line 49-50: The test assertions in SocialLinksPageTest.php at lines
49-50 are checking for exact inline style strings which makes the test brittle
to whitespace or property order changes. Instead of using toContain to match the
full style string '--accent-light: `#0F172A`; --accent-dark: `#FFFFFF`;', split
these assertions to independently verify that the HTML contains the individual
CSS custom property tokens (--accent-light: `#0F172A` and --accent-dark: `#FFFFFF`
separately) so the test only fails if the actual CSS values change, not the
formatting.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository YAML (base), Central YAML (inherited)
Review profile: CHILL
Plan: Pro
Run ID: ee1f96a9-420e-44be-b47f-eb9897f1c7a2
📒 Files selected for processing (9)
app-modules/he4rt/resources/css/components/button.cssapp-modules/portal/resources/views/components/layouts/app.blade.phpapp-modules/portal/resources/views/components/logo.blade.phpapp-modules/portal/resources/views/components/navbar.blade.phpapp-modules/portal/resources/views/social-links.blade.phpapp-modules/portal/src/DTOs/SocialLink.phpapp-modules/portal/src/Livewire/SocialLinksPage.phpapp-modules/portal/tests/Feature/HomepageTest.phpapp-modules/portal/tests/Feature/SocialLinksPageTest.php
|
Tip For best results, initiate chat on the files or code changes.
✏️ Learnings added
|
Summary