-
Notifications
You must be signed in to change notification settings - Fork 5
Fix: WhatsApp Forms Cypress tests after icon updates and conditional rendering changes #200
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
📝 WalkthroughWalkthroughThis PR updates the Cypress E2E test for WhatsApp Forms, aligning the test suite with API schema changes and UI interaction updates. The GraphQL response shape is updated from Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested reviewers
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
cypress/e2e/wa_forms/wa_form.spec.ts (1)
276-276: Consider making the selector more robust.The text-based selector
cy.contains('second form')is more descriptive than the previous approach but could be fragile if form names change or if partial text matches occur. Consider these alternatives:
- Use a data-testid on the table row:
cy.get('[data-testid="form-row-2"]').find('[data-testid="view-form"]')- Add exact match:
cy.contains('tr', 'second form').find('[data-testid="view-form"]')The current implementation works but may require maintenance if test data changes.
🔎 Alternative selector approaches
Option 1: Using form ID in data-testid
- cy.contains('second form').closest('tr').find('[data-testid="view-form"]').click(); + cy.get('[data-testid="form-row-2"]').find('[data-testid="view-form"]').click();Option 2: More specific text match
- cy.contains('second form').closest('tr').find('[data-testid="view-form"]').click(); + cy.contains('tr', 'second form').find('[data-testid="view-form"]').click();
📜 Review details
Configuration used: defaults
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
cypress/e2e/wa_forms/wa_form.spec.ts
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: glific (1.18.3-otp-27, 27.3.3)
🔇 Additional comments (1)
cypress/e2e/wa_forms/wa_form.spec.ts (1)
34-34: No changes needed. The mock response structure is correct as-is. In GraphQL, operation names and response field names serve different purposes and don't need to match—listWhatsappForms(operation) →whatsappForms(response field) follows standard GraphQL conventions for list operations.
46d9235
into
feat/whatsapp_form_phase2
Frontend pr: glific/glific-frontend#3696