Skip to content

Prepare for 6.23#2462

Closed
Crabcyborg wants to merge 4 commits into
masterfrom
prepare_for_6.23
Closed

Prepare for 6.23#2462
Crabcyborg wants to merge 4 commits into
masterfrom
prepare_for_6.23

Conversation

@Crabcyborg
Copy link
Copy Markdown
Contributor

No description provided.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Aug 12, 2025

Walkthrough

Cypress e2e tests were updated: two files received formatting-only changes, and one Forms test altered banner text detection from includes to match and expanded acceptable h1 headings. No exported/public APIs changed.

Changes

Cohort / File(s) Summary of Changes
Entries page validations
tests/cypress/e2e/Entries/EntriesPageDataValidations.cy.js
Whitespace/indentation adjustment in a oneOf string array; no functional changes.
Form Templates test setup
tests/cypress/e2e/Form Templates/FormTemplates.cy.js
Added a blank line after cy.viewport in beforeEach; no functional changes.
Forms page data validation
tests/cypress/e2e/Forms/formPageDataValidation.cy.js
Logic tweak: banner detection for "Get 60% Off Pro!" uses text.match instead of includes; allowed h1 list extended with an additional variant; minor indentation tweak.

Sequence Diagram(s)

(no diagrams)

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch prepare_for_6.23

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

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

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (1)
tests/cypress/e2e/Forms/formPageDataValidation.cy.js (1)

34-35: Enrich error details for faster triage

Include href in the thrown error to see which link failed without re-running locally.

Apply this diff:

-                } else {
-      				throw new Error(`Unexpected banner text or missing href: "${text}"`);
+                } else {
+      				throw new Error(`Unexpected banner or missing href — text: "${text}", href: "${href || 'N/A'}"`);
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between eb5e404 and bf122fa.

📒 Files selected for processing (3)
  • tests/cypress/e2e/Entries/EntriesPageDataValidations.cy.js (1 hunks)
  • tests/cypress/e2e/Form Templates/FormTemplates.cy.js (1 hunks)
  • tests/cypress/e2e/Forms/formPageDataValidation.cy.js (1 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (1)
tests/cypress/e2e/Forms/formPageDataValidation.cy.js (1)
js/formidable_admin.js (1)
  • href (10881-10881)
⏰ 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). (2)
  • GitHub Check: Cypress
  • GitHub Check: Cypress
🔇 Additional comments (2)
tests/cypress/e2e/Form Templates/FormTemplates.cy.js (1)

6-7: Formatting-only change — OK to merge

Adding a blank line after cy.viewport has no functional impact. Good to keep setup steps visually separated.

tests/cypress/e2e/Entries/EntriesPageDataValidations.cy.js (1)

55-57: Whitespace-only indentation tweak — OK

No semantic changes; the assertion still validates the same strings.

const href = $el.attr('href');

if (href && (text.includes('upgrading to PRO') || text.includes( 'Get 60% Off Pro!' ) || text.match(/GET \d+% OFF|SAVE \d+%/))) {
if (href && (text.includes('upgrading to PRO') || text.match('Get 60% Off Pro!') || text.match(/GET \d+% OFF|SAVE \d+%/))) {
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.

🛠️ Refactor suggestion

Harden banner detection with a single case-insensitive regex

Switching to match() is fine, but the current combination is brittle due to case/wording variants. A single case-insensitive regex keeps intent while reducing flakiness.

Apply this diff:

-                if (href && (text.includes('upgrading to PRO') || text.match('Get 60% Off Pro!') || text.match(/GET \d+% OFF|SAVE \d+%/))) {
+                if (href && /(?:upgrad(?:e|ing) to pro)|get \d+% off(?: pro!)?|save \d+%/i.test(text)) {
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
if (href && (text.includes('upgrading to PRO') || text.match('Get 60% Off Pro!') || text.match(/GET \d+% OFF|SAVE \d+%/))) {
if (href && /(?:upgrad(?:e|ing) to pro)|get \d+% off(?: pro!)?|save \d+%/i.test(text)) {
🤖 Prompt for AI Agents
In tests/cypress/e2e/Forms/formPageDataValidation.cy.js around line 21, the
banner detection uses multiple brittle case-sensitive checks; replace them with
a single case-insensitive regex and a null-safe test. Update the condition to
ensure text exists then test it with a regex that matches variants like
"upgrading to pro", "get X% off" (optionally "pro") or "save X%" (for example
use a pattern such as /(?:upgrading to pro|get \d+% off(?: pro)?|save \d+%)/i)
so the check is robust to casing and wording variants.

Comment on lines 24 to 31
cy.get('h1').should(($h1) => {
const headingText = $h1.text();
expect([
'The Only WordPress Form Maker & Application Builder Plugin',
'Upgrade Today to Unlock the Full Power of Formidable Forms'
'Upgrade Today to Unlock the Full Power of Formidable Forms',
'The Most Advanced WordPress Form builder'
]).to.include(headingText);
});
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.

🛠️ Refactor suggestion

Make heading check trim- and case-insensitive to avoid brittle failures

The external page H1 may have minor case/copy tweaks or whitespace. Normalize and check against allowed variants case-insensitively.

Apply this diff:

-                        cy.get('h1').should(($h1) => {
-                            const headingText = $h1.text();
-                            expect([
-                                'The Only WordPress Form Maker & Application Builder Plugin',
-                                'Upgrade Today to Unlock the Full Power of Formidable Forms',
-                                'The Most Advanced WordPress Form builder'
-                            ]).to.include(headingText);
-                        });
+                        cy.get('h1').should(($h1) => {
+                            const headingText = $h1.text().trim();
+                            const allowedHeadings = [
+                                'The Only WordPress Form Maker & Application Builder Plugin',
+                                'Upgrade Today to Unlock the Full Power of Formidable Forms',
+                                'The Most Advanced WordPress Form Builder'
+                            ];
+                            expect(allowedHeadings.map(h => h.toLowerCase())).to.include(headingText.toLowerCase());
+                        });
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
cy.get('h1').should(($h1) => {
const headingText = $h1.text();
expect([
'The Only WordPress Form Maker & Application Builder Plugin',
'Upgrade Today to Unlock the Full Power of Formidable Forms'
'Upgrade Today to Unlock the Full Power of Formidable Forms',
'The Most Advanced WordPress Form builder'
]).to.include(headingText);
});
cy.get('h1').should(($h1) => {
const headingText = $h1.text().trim();
const allowedHeadings = [
'The Only WordPress Form Maker & Application Builder Plugin',
'Upgrade Today to Unlock the Full Power of Formidable Forms',
'The Most Advanced WordPress Form Builder'
];
expect(
allowedHeadings
.map(h => h.toLowerCase())
.includes(headingText.toLowerCase())
).to.be.true;
});
🤖 Prompt for AI Agents
In tests/cypress/e2e/Forms/formPageDataValidation.cy.js around lines 24 to 31,
the H1 assertion is brittle because it compares raw text; change it to normalize
the heading by trimming whitespace and converting to lower-case, and compare
against a list of allowed variants that are also lower-cased; update the
assertion to call headingText.trim().toLowerCase() and assert inclusion in
allowedVariants.map(v => v.toLowerCase()) so the check becomes both trim- and
case-insensitive.

@Crabcyborg Crabcyborg closed this Aug 12, 2025
@Crabcyborg Crabcyborg deleted the prepare_for_6.23 branch August 12, 2025 15:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants