Fix apiVersion number mismatch#4061
Conversation
📝 WalkthroughWalkthroughUpdated the ParselyRecommendations block registration apiVersion to 3 and adjusted end-to-end tests to target the editor canvas FrameLocator instead of the Playwright Page for locating block content and assertions. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Suggested labels
Suggested reviewers
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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 |
|
@copilot, can you understand why E2E tests fail here, and propose a fix? It shouldn't break any functionality, and the tests should pass without compromising their quality. |
Co-authored-by: acicovic <23142906+acicovic@users.noreply.github.com> Agent-Logs-Url: https://github.com/Parsely/wp-parsely/sessions/fcbc58e6-481a-443e-adbd-e0d0b67d1fd5
Fix failing E2E tests for PR #4061
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@tests/e2e/specs/blocks/recommendations/settings.spec.ts`:
- Around line 48-49: The test currently asserts on the Locator object itself
using
expect(editor.canvas.locator('.parsely-recommendations-image')).toBeTruthy(),
which is ineffective; replace this with a Playwright locator assertion that
checks DOM presence/visibility (for example, await
expect(editor.canvas.locator('.parsely-recommendations-image')).toBeVisible() or
toHaveCount(1)) and ensure the expect call is awaited so the assertion queries
the page rather than the Locator object.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: fa42a4e6-102c-4b60-8c68-8f62f857eca4
⛔ Files ignored due to path filters (2)
build/blocks/recommendations/edit.asset.phpis excluded by!build/**build/blocks/recommendations/edit.jsis excluded by!build/**
📒 Files selected for processing (2)
tests/e2e/specs/blocks/recommendations/errors.spec.tstests/e2e/specs/blocks/recommendations/settings.spec.ts
Description
With this PR, we're fixing the mismatch between
apiVersionin ourblocks/recommendations/edit.tsxandblocks/recommendations/block.jsonfiles, which were2and3respectively. We update this to3.Motivation and context
We shouldn't have mismatching
apiVersionnumbers. Having them out of sync is a bug waiting to surface and should be fixed.How has this been tested?
Existing tests pass.
Summary by CodeRabbit