Skip to content

[chores] Updated Twitter reference to X#1046

Open
Ayush4958 wants to merge 12 commits into
openwisp:masterfrom
Ayush4958:master
Open

[chores] Updated Twitter reference to X#1046
Ayush4958 wants to merge 12 commits into
openwisp:masterfrom
Ayush4958:master

Conversation

@Ayush4958
Copy link
Copy Markdown

Checklist

  • I have read the OpenWISP Contributing Guidelines.
  • I have manually tested the changes proposed in this pull request.
  • I have written new test cases for new code and/or updated existing tests for changes to existing code.
  • I have updated the documentation.

Reference to Existing Issue

Closes #1043

Description of Changes

Added X Social in the place where previously Twitter social was used

Screenshot

image

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 2, 2026

📝 Walkthrough

Walkthrough

The changes replace Twitter branding with X across test fixtures and organization configuration: alt text and CSS classes (twitterx), icon filenames (twitter.svgx.svg), and target URLs (twitter.com/...x.com/...) in the component test, test config, and organizations/default/default.yml. No component logic, exported signatures, or rendering conditions were modified.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes


Caution

Pre-merge checks failed

Please resolve all errors before merging. Addressing warnings is optional.

  • Ignore

❌ Failed checks (1 error)

Check name Status Explanation Resolution
Bug Fixes ❌ Error Pull request masks bug through snapshot update; production config missing required css property. Add css property to X social link in organizations/default/default.yml and client/test-config.json, revert snapshot, and add browser test.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title '[chores] Updated Twitter reference to X' follows the required format with [type] prefix and clearly describes the main change of replacing Twitter references with X throughout the codebase.
Description check ✅ Passed The PR description covers all required template sections: checklist completed, reference to issue #1043, clear description of changes, and includes a relevant screenshot showing the X social icon.
Linked Issues check ✅ Passed The PR successfully addresses the linked issue #1043 by replacing all Twitter social icon references with X icons across the test files, configuration files, and related components.
Out of Scope Changes check ✅ Passed All changes are directly related to replacing Twitter references with X icons as specified in issue #1043; no unrelated modifications were introduced.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

Comment @coderabbitai help to get the list of available commands and usage tips.

@Ayush4958 Ayush4958 changed the title Added X social in place of Twitter social feat(social): added X Social icon Mar 2, 2026
@openwisp-companion
Copy link
Copy Markdown

Multiple Snapshot Failures and Babel Warnings

Hello @Ayush4958 and @nemesifier,
(Analysis for commit 1c329b7)

There are multiple test failures due to snapshot mismatches and several warnings related to Babel configuration.

1. Test Failures (Snapshot Mismatches)

  • Explanation: Several Jest snapshot tests are failing across different components (Login, PasswordConfirm, Contact, Status). This indicates that the rendered output of these components has changed unexpectedly, and the snapshots need to be updated to reflect these changes. The specific changes are related to updated social media links (Twitter to X) and potentially other UI adjustments.
  • Remediation: To fix these failures, you need to update the snapshots. Run the following command in your terminal:
    yarn run coverage -u
    This command will update the existing snapshots with the new rendered output. After updating, review the changes to ensure they are intentional.

2. Babel Configuration Warnings

  • Explanation: The CI logs show multiple warnings from Babel regarding the loose mode configuration for private methods and properties. Babel is indicating that the loose option should be consistent across related plugins (@babel/plugin-transform-private-methods, @babel/plugin-transform-private-property-in-object, @babel/plugin-transform-class-properties). Currently, it seems preset-env is set to loose: false, while private property/method plugins are set to loose: true. This inconsistency can lead to unexpected behavior.

  • Remediation: Update your Babel configuration to ensure consistency in the loose mode setting. Based on the provided babel.config.js, it appears that loose: true is already set for proposal-private-property-in-object. You should ensure that @babel/preset-env also uses loose: true or explicitly configure the plugins to silence the warning.

    Modify your babel.config.js to look like this:

    module.exports = {
      presets: [
        [
          "@babel/preset-env",
          {
            targets: {
              ie: "11",
            },
            // Add loose: true here to match other plugins
            loose: true,
          },
        ],
        "@babel/preset-react",
      ],
      plugins: [
        ["@babel/plugin-transform-runtime"],
        ["@babel/plugin-proposal-class-properties", {loose: true}],
        ["@babel/plugin-transform-arrow-functions"],
        ["@babel/plugin-syntax-dynamic-import"],
        ["@babel/plugin-proposal-private-property-in-object", {loose: true}],
        ["@babel/plugin-transform-spread"],
        "transform-remove-strict-mode",
      ],
    };

    Alternatively, you can explicitly add the plugin with the loose: true option as suggested in the warning:

    // In your Babel config plugins array:
    ["@babel/plugin-transform-private-methods", { "loose": true }]

    Ensure this is applied consistently to avoid the warnings.

@kilo-code-bot
Copy link
Copy Markdown

kilo-code-bot Bot commented Mar 7, 2026

Code Review Summary

Status: No Issues Found | Recommendation: Merge

This PR successfully rebrands Twitter to X across the codebase. All changes are consistent and complete.

Files Reviewed (7 files)
  • organizations/default/default.yml - Configuration updated with X social links (alt text, icon, URL)
  • organizations/default/client_assets/X.svg - New X logo file added
  • client/components/contact-box/contact.test.js - Test data updated (also fixes typo: twiter.svgX.svg)
  • client/components/contact-box/__snapshots__/contact.test.js.snap - Snapshot updated
  • client/components/login/__snapshots__/login.test.js.snap - Snapshot updated
  • client/components/password-confirm/__snapshots__/password-confirm.test.js.snap - Snapshot updated
Other Observations
File Note
organizations/default/client_assets/twitter.svg Old Twitter logo still exists - consider removing in a follow-up cleanup PR

@openwisp-companion
Copy link
Copy Markdown

Commit Message Failure

Hello @Ayush4958,
(Analysis for commit 5ae2c4b)

There's an issue with your commit message format. OpenWISP requires a specific format for commit messages to ensure consistency and clarity.

Explanation:

The CI pipeline detected that the commit message does not adhere to the expected format. Specifically, it's missing the required structure for the commit title, body, and footer, which includes referencing an issue number.

Remediation:

Please reformat your commit message according to the following convention:

[tag] Capitalized short title #<issue_number>

<Detailed description of the changes, explaining why they were made and how they address the issue.>

Fixes #<issue_number>

Example:

[fix] Update user authentication logic #123

This commit addresses an issue where users were unable to log in due to an incorrect validation check. The logic has been updated to correctly validate user credentials, resolving the login failures.

Fixes #123

Please update your commit message and push the changes again.

Ayush4958 added a commit to Ayush4958/openwisp-wifi-login-pages that referenced this pull request Mar 8, 2026
Ayush4958 added a commit to Ayush4958/openwisp-wifi-login-pages that referenced this pull request Mar 8, 2026
@openwisp-companion
Copy link
Copy Markdown

Commit Message Failure

Hello @Ayush4958,
(Analysis for commit e551371)

The CI pipeline failed because the commit message does not adhere to the project's conventions. Specifically, the commit message is missing the required closing keyword and issue number in the footer.

Explanation:
OpenWISP enforces a strict commit message format to ensure clarity and traceability of changes. The commit message must include a footer that specifies how the commit relates to an issue, typically using a closing keyword like "Fixes", "Closes", or "Resolves" followed by the issue number (e.g., #123).

Remediation:
Please update your commit message to follow the correct format. Here's an example of the expected structure:

[tag] Capitalized short title #<issue>

Optional detailed description of the changes.

Fixes #<issue_number>

For instance, if your commit fixes issue #1046, a valid commit message would look like this:

[fix] Update snapshot for issue #1046

This commit updates the snapshot file to reflect the latest changes in the UI.

Fixes #1046

@openwisp-companion
Copy link
Copy Markdown

Commit Message Failure

Hello @Ayush4958,
(Analysis for commit c6ee341)

Explanation:
The CI build failed due to an invalid commit message format. OpenWISP enforces a specific convention for commit messages to ensure clarity and consistency. The error message indicates that an issue referenced in the title (e.g., #1046) must also be referenced in the body of the commit message using keywords like Fixes, Closes, or Related to.

Remediation:
Please update your commit message to follow the OpenWISP commit message guidelines. Here's an example of the correct format:

[tag] Capitalized short title #<issue_number>

[Blank line required after the header]

Detailed explanation of the changes, including references to issues if applicable.
For example:
Fixes #<issue_number>

For your specific commit, it should look something like this:

[fix] Updates snapshot for #1046

This commit updates the snapshot for issue #1046.
Fixes #1046

Ayush4958 added a commit to Ayush4958/openwisp-wifi-login-pages that referenced this pull request Mar 8, 2026
@openwisp-companion
Copy link
Copy Markdown

Commit Message Format Violation

Hello @Ayush4958,
(Analysis for commit b8a68bb)

Explanation:
The CI pipeline failed because the commit message does not adhere to the OpenWISP commit message conventions. Specifically, the error message indicates that an issue was referenced in the commit title but not in the body.

Remediation:
Please update your commit message to follow the correct format. The header should be [tag] Capitalized short title #<issue>, followed by a blank line, a detailed description of the changes, and finally a footer with a closing keyword and the issue number (e.g., Fixes #123).

Here's an example of the correct format:

[fix] Update snapshot for #1046

This commit updates the snapshot tests to reflect the recent changes in the UI.
The previous snapshot was outdated and caused the tests to fail.

Fixes #1046

Ayush4958 added a commit to Ayush4958/openwisp-wifi-login-pages that referenced this pull request Mar 8, 2026
@openwisp-companion
Copy link
Copy Markdown

Commit Message Failure

Hello @Ayush4958,
(Analysis for commit d7137dc)

The CI pipeline failed because the commit message does not adhere to the expected OpenWISP format.

Explanation:
The commit message is missing the required [tag] prefix and a blank line between the subject and the body. It also lacks a closing keyword and issue number in the footer.

Remediation:
Please reformat your commit message to follow the OpenWISP convention. A correct commit message should look like this:

[tag] Capitalized short title #<issue>

<detailed description of changes>

Fixes #<issue>

For example, based on your commit, a corrected message might be:

[fix] Update snapshots for login, password-confirm, and contact-box #1046

Updated snapshots for the login, password-confirm, and contact-box components to reflect recent changes. This ensures that the UI tests pass with the latest UI elements.

Fixes #1046

…enwisp#1046

Updated snapshots to match current rendered output after recent changes.

Fixes openwisp#1046
@Ayush4958
Copy link
Copy Markdown
Author

@nemesifier ,
Branch have no issues so
it can be merged easily without any problem

thanks ...

@Ayush4958
Copy link
Copy Markdown
Author

Hi @nemesifier ,
Everything is fine with the branch and It's ready to push
I am also willing to make changes on suggestions

@nemesifier
Copy link
Copy Markdown
Member

@Ayush4958 thanks, I am busy testing other PRs which are more critical, please leave this open and as soon as I double check with manual testing I will merge. We don't merge PRs without manual verification and this takes time. Thanks.

@Ayush4958
Copy link
Copy Markdown
Author

Okay , Understandable now ,
I will leave it open

@nemesifier nemesifier changed the title feat(social): added X Social icon [chores] Updated Twitter reference to X Mar 24, 2026
@nemesifier nemesifier added the enhancement New feature or request label Mar 24, 2026
Copy link
Copy Markdown
Member

@nemesifier nemesifier left a comment

Choose a reason for hiding this comment

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

A new SVG is being added, but there's already an existing one which should be renamed instead: organizations/default/client_assets/twitter.svg.

alt="X"
class="contact-image "
src="/assets/default/twitter.svg"
src="/assets/default/X.svg"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
src="/assets/default/X.svg"
src="/assets/default/x.svg"

Applies to all other occurrences

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Completed

<a
className="link "
href="https://twitter.com/openwisp"
href="https://X.com/openwisp"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
href="https://X.com/openwisp"
href="https://x.com/openwisp"

applies to all other occurrences

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Sorry late answering , I had made the changes

Copy link
Copy Markdown

@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: 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 `@client/components/contact-box/contact.test.js`:
- Around line 15-19: Update the test in contact.test.js to assert the actual
rendered link metadata for the X entry instead of only checking the
presence/count of the `.link.X` CSS class: locate the test that uses the X
fixture (the object with keys alt, icon, url, authenticated, css) and add
assertions that the rendered anchor element with class `.link.X` has the correct
href attribute equal to the fixture's url and that the image (or accessible
element) uses the expected alt text from the fixture; also add similar href/alt
assertions in the other related tests that currently only check `.link.X` (the
ones referenced around the other assertions) so the behavior is validated beyond
CSS class matching.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: a5a1f45a-53a3-4c5a-ac5e-57683b768911

📥 Commits

Reviewing files that changed from the base of the PR and between 6aca583 and d6a632d.

⛔ Files ignored due to path filters (4)
  • client/components/contact-box/__snapshots__/contact.test.js.snap is excluded by !**/*.snap
  • client/components/login/__snapshots__/login.test.js.snap is excluded by !**/*.snap
  • client/components/password-confirm/__snapshots__/password-confirm.test.js.snap is excluded by !**/*.snap
  • organizations/default/client_assets/x.svg is excluded by !**/*.svg
📒 Files selected for processing (1)
  • client/components/contact-box/contact.test.js
📜 Review details
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{test,spec}.{js,ts,jsx,tsx,py,java,rb,go}

📄 CodeRabbit inference engine (Custom checks)

**/*.{test,spec}.{js,ts,jsx,tsx,py,java,rb,go}: Bug Fixes: Tests must be deterministic and not flaky, avoiding dependencies on timing, sleeps, specific timezones, system time, randomness without fixed seeds, race conditions, concurrency timing, network access, external services, filesystem state, environment-specific configuration, execution order, shared global state, hardcoded ports, or unawaited async operations
Changes: Tests must be updated to cover non-trivial changes and ensure proper validation of modified behavior
Features: Tests must be added with coverage that does not decrease significantly; for UI features, Selenium browser tests are preferred
General: Ensure tests cover the happy path, error paths, boundary values, and unusual inputs

Files:

  • client/components/contact-box/contact.test.js
🧠 Learnings (5)
📓 Common learnings
Learnt from: CR
Repo: openwisp/openwisp-wifi-login-pages PR: 0
File: coderabbit-custom-pre-merge-checks-unique-id-file-non-traceable-F7F2B60C-1728-4C9A-8889-4F2235E186CA.txt:0-0
Timestamp: 2026-03-19T22:44:00.665Z
Learning: Applies to **/*.{test,spec}.{js,ts,jsx,tsx,py,java,rb,go} : Changes: Tests must be updated to cover non-trivial changes and ensure proper validation of modified behavior
📚 Learning: 2026-03-19T22:44:00.665Z
Learnt from: CR
Repo: openwisp/openwisp-wifi-login-pages PR: 0
File: coderabbit-custom-pre-merge-checks-unique-id-file-non-traceable-F7F2B60C-1728-4C9A-8889-4F2235E186CA.txt:0-0
Timestamp: 2026-03-19T22:44:00.665Z
Learning: Applies to **/*.{test,spec}.{js,ts,jsx,tsx,py,java,rb,go} : Changes: Tests must be updated to cover non-trivial changes and ensure proper validation of modified behavior

Applied to files:

  • client/components/contact-box/contact.test.js
📚 Learning: 2026-03-19T22:44:00.665Z
Learnt from: CR
Repo: openwisp/openwisp-wifi-login-pages PR: 0
File: coderabbit-custom-pre-merge-checks-unique-id-file-non-traceable-F7F2B60C-1728-4C9A-8889-4F2235E186CA.txt:0-0
Timestamp: 2026-03-19T22:44:00.665Z
Learning: Applies to **/*.{test,spec}.{js,ts,jsx,tsx,py,java,rb,go} : Bug Fixes: Tests must be deterministic and not flaky, avoiding dependencies on timing, sleeps, specific timezones, system time, randomness without fixed seeds, race conditions, concurrency timing, network access, external services, filesystem state, environment-specific configuration, execution order, shared global state, hardcoded ports, or unawaited async operations

Applied to files:

  • client/components/contact-box/contact.test.js
📚 Learning: 2026-03-19T22:44:00.665Z
Learnt from: CR
Repo: openwisp/openwisp-wifi-login-pages PR: 0
File: coderabbit-custom-pre-merge-checks-unique-id-file-non-traceable-F7F2B60C-1728-4C9A-8889-4F2235E186CA.txt:0-0
Timestamp: 2026-03-19T22:44:00.665Z
Learning: Applies to **/*.{test,spec}.{js,ts,jsx,tsx,py,java,rb,go} : Features: Tests must be added with coverage that does not decrease significantly; for UI features, Selenium browser tests are preferred

Applied to files:

  • client/components/contact-box/contact.test.js
📚 Learning: 2026-03-18T17:34:09.903Z
Learnt from: prathmeshkulkarni-coder
Repo: openwisp/openwisp-wifi-login-pages PR: 1063
File: client/components/status/status.test.js:2890-2916
Timestamp: 2026-03-18T17:34:09.903Z
Learning: Do not rely on mocking or altering window.location in Jest/JSDOM for this project. Since window.location is non-configurable in the test environment and attempts to redefine or delete it can cause state leaks across tests, avoid hacks like delete window.location or Object.defineProperty(window, 'location', ...) in tests. Instead, migrate detection-related tests to React Testing Library (RTL) and use RTL-friendly patterns (e.g., render components and inspect behavior via UI, or mock network/detection logic with explicit dependency injection or module mocks). This pattern should apply to all test files under client/components (any .test.js) where window.location might be interacted with.

Applied to files:

  • client/components/contact-box/contact.test.js

Comment thread client/components/contact-box/contact.test.js Outdated
…penwisp#1046

Updated snapshots for the login, password-confirm, and contact-box components to reflect recent changes. This ensures that the UI tests pass with the latest UI elements.
Fixes openwisp#1046

Signed-off-by: Ayush <bhandariayush935@gmail.com>
…penwisp#1046

Updated snapshots for the login, password-confirm, and contact-box components to reflect recent changes. This ensures that the UI tests pass with the latest UI elements.
Fixes openwisp#1046

Signed-off-by: Ayush <bhandariayush935@gmail.com>
Copy link
Copy Markdown

@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: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
client/test-config.json (1)

158-169: ⚠️ Potential issue | 🔴 Critical

Add missing css property to the X social link.

Similar to the issue in organizations/default/default.yml, this test configuration is missing the css property that the contact component requires to generate CSS class selectors. Without this property, tests will fail when they expect .link.x selectors.

🔧 Proposed fix to add the css property
         "social_links": [
           {
             "alt": "x",
             "icon": "x.svg",
-            "url": "https://x.com/openwisp"
+            "url": "https://x.com/openwisp",
+            "css": "x"
           },
           {
             "alt": "facebook",
             "icon": "facebook.svg",
-            "url": "https://facebook.com/openwisp"
+            "url": "https://facebook.com/openwisp",
+            "css": "facebook"
           }
         ]

Based on the component implementation at client/components/contact-box/contact.js:45,52 which uses link.css to generate the CSS class.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@client/test-config.json` around lines 158 - 169, The X social link in the
social_links array is missing the css property required by the contact component
(which reads link.css to build class selectors); update the X entry in the
social_links array so it includes a css property (e.g., "css": "x") matching the
alt/icon identifier used to produce the .link.x selector so tests expecting that
selector will pass.
♻️ Duplicate comments (2)
client/components/contact-box/contact.test.js (2)

64-73: ⚠️ Potential issue | 🟡 Minor

Assert X link metadata directly (not only class presence).

The test only verifies CSS class presence but doesn't validate the actual rendered link attributes (href, alt). As noted in a previous review, tests should assert the X link's metadata to properly validate the Twitter → X migration.

✅ Suggested test hardening
   it("should render without authenticated links when not authenticated", () => {
     props = createTestProps();
     props.contactPage.social_links = links;
     props.isAuthenticated = false;
     const wrapper = shallow(<Contact {...props} />);
     expect(wrapper.find(".contact-image")).toHaveLength(2);
     expect(wrapper.find(".link.google")).toHaveLength(1);
     expect(wrapper.find(".link.facebook")).toHaveLength(1);
-    expect(wrapper.find(".link.x")).toHaveLength(0);
+    // X link should be hidden when not authenticated
+    expect(wrapper.find(".link.x")).toHaveLength(0);
   });

As per coding guidelines: "Tests must be updated to cover non-trivial changes and ensure proper validation of modified behavior".

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@client/components/contact-box/contact.test.js` around lines 64 - 73, Update
the test "should render without authenticated links when not authenticated" in
contact.test.js to assert the X link's rendered attributes (not just its class).
After rendering Contact with props.contactPage.social_links = links and
isAuthenticated = false, locate the X link (wrapper.find(".link.x") or the
anchor element within it) and assert its href and alt/title/text match the
expected values coming from the links test fixture (the links variable) so the X
(Twitter→X) migration is verified end-to-end.

75-84: ⚠️ Potential issue | 🟡 Minor

Assert X link metadata directly (not only class presence).

The test only verifies CSS class count but doesn't validate that the rendered X link has the correct href and alt attributes. This leaves the Twitter → X migration incompletely tested.

✅ Suggested test hardening
   it("should render with authenticated links when authenticated", () => {
     props = createTestProps();
     props.contactPage.social_links = links;
     props.isAuthenticated = true;
     const wrapper = shallow(<Contact {...props} />);
     expect(wrapper.find(".contact-image")).toHaveLength(2);
     expect(wrapper.find(".link.google")).toHaveLength(1);
-    expect(wrapper.find(".link.x")).toHaveLength(1);
+    const xLink = wrapper.find(".link.x");
+    expect(xLink).toHaveLength(1);
+    expect(xLink.at(0).prop("href")).toBe("https://x.com/openwisp");
+    const xImage = xLink.find(".contact-image");
+    expect(xImage).toHaveLength(1);
+    expect(xImage.at(0).prop("alt")).toBe("x");
     expect(wrapper.find(".link.facebook")).toHaveLength(0);
   });

As per coding guidelines: "Tests must be updated to cover non-trivial changes and ensure proper validation of modified behavior".

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@client/components/contact-box/contact.test.js` around lines 75 - 84, The test
"should render with authenticated links when authenticated" only checks element
counts; update it to assert the X link's actual attributes by locating the
rendered X link for the Contact component (use the test's
props.contactPage.social_links / links fixture and the .link.x selector used in
the test) and verify its href and alt/text match the expected values from the
links fixture (e.g., links.x.url and links.x.alt), in addition to the existing
class presence assertions.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@organizations/default/default.yml`:
- Around line 134-137: Add the missing css property to the X social link entry
so the contact component can generate the correct CSS class (it currently only
has alt/icon/url). Update the social link object (the X entry) to include css:
"x" so client/components/contact-box/contact.js (which reads link.css) will
produce className="link x" and satisfy the tests referenced in contact.test.js.

---

Outside diff comments:
In `@client/test-config.json`:
- Around line 158-169: The X social link in the social_links array is missing
the css property required by the contact component (which reads link.css to
build class selectors); update the X entry in the social_links array so it
includes a css property (e.g., "css": "x") matching the alt/icon identifier used
to produce the .link.x selector so tests expecting that selector will pass.

---

Duplicate comments:
In `@client/components/contact-box/contact.test.js`:
- Around line 64-73: Update the test "should render without authenticated links
when not authenticated" in contact.test.js to assert the X link's rendered
attributes (not just its class). After rendering Contact with
props.contactPage.social_links = links and isAuthenticated = false, locate the X
link (wrapper.find(".link.x") or the anchor element within it) and assert its
href and alt/title/text match the expected values coming from the links test
fixture (the links variable) so the X (Twitter→X) migration is verified
end-to-end.
- Around line 75-84: The test "should render with authenticated links when
authenticated" only checks element counts; update it to assert the X link's
actual attributes by locating the rendered X link for the Contact component (use
the test's props.contactPage.social_links / links fixture and the .link.x
selector used in the test) and verify its href and alt/text match the expected
values from the links fixture (e.g., links.x.url and links.x.alt), in addition
to the existing class presence assertions.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: db1effd1-f56e-4e10-9211-2daa9162bcd0

📥 Commits

Reviewing files that changed from the base of the PR and between d6a632d and 942604f.

⛔ Files ignored due to path filters (4)
  • client/components/contact-box/__snapshots__/contact.test.js.snap is excluded by !**/*.snap
  • client/components/login/__snapshots__/login.test.js.snap is excluded by !**/*.snap
  • client/components/mobile-phone-change/__snapshots__/mobile-phone-change.test.js.snap is excluded by !**/*.snap
  • client/components/password-confirm/__snapshots__/password-confirm.test.js.snap is excluded by !**/*.snap
📒 Files selected for processing (3)
  • client/components/contact-box/contact.test.js
  • client/test-config.json
  • organizations/default/default.yml
📜 Review details
⏰ 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: Tests and Coverage
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{test,spec}.{js,ts,jsx,tsx,py,java,rb,go}

📄 CodeRabbit inference engine (Custom checks)

**/*.{test,spec}.{js,ts,jsx,tsx,py,java,rb,go}: Bug Fixes: Tests must be deterministic and not flaky, avoiding dependencies on timing, sleeps, specific timezones, system time, randomness without fixed seeds, race conditions, concurrency timing, network access, external services, filesystem state, environment-specific configuration, execution order, shared global state, hardcoded ports, or unawaited async operations
Changes: Tests must be updated to cover non-trivial changes and ensure proper validation of modified behavior
Features: Tests must be added with coverage that does not decrease significantly; for UI features, Selenium browser tests are preferred
General: Ensure tests cover the happy path, error paths, boundary values, and unusual inputs

Files:

  • client/components/contact-box/contact.test.js
🧠 Learnings (3)
📓 Common learnings
Learnt from: CR
Repo: openwisp/openwisp-wifi-login-pages PR: 0
File: coderabbit-custom-pre-merge-checks-unique-id-file-non-traceable-F7F2B60C-1728-4C9A-8889-4F2235E186CA.txt:0-0
Timestamp: 2026-03-19T22:44:00.665Z
Learning: Changes: PR description must include screenshots or screen recordings for any UI changes
Learnt from: CR
Repo: openwisp/openwisp-wifi-login-pages PR: 0
File: coderabbit-custom-pre-merge-checks-unique-id-file-non-traceable-F7F2B60C-1728-4C9A-8889-4F2235E186CA.txt:0-0
Timestamp: 2026-03-19T22:44:00.665Z
Learning: Applies to **/*.{test,spec}.{js,ts,jsx,tsx,py,java,rb,go} : Changes: Tests must be updated to cover non-trivial changes and ensure proper validation of modified behavior
📚 Learning: 2026-03-19T22:44:00.665Z
Learnt from: CR
Repo: openwisp/openwisp-wifi-login-pages PR: 0
File: coderabbit-custom-pre-merge-checks-unique-id-file-non-traceable-F7F2B60C-1728-4C9A-8889-4F2235E186CA.txt:0-0
Timestamp: 2026-03-19T22:44:00.665Z
Learning: Applies to **/*.{test,spec}.{js,ts,jsx,tsx,py,java,rb,go} : Changes: Tests must be updated to cover non-trivial changes and ensure proper validation of modified behavior

Applied to files:

  • client/components/contact-box/contact.test.js
📚 Learning: 2026-03-18T17:34:09.903Z
Learnt from: prathmeshkulkarni-coder
Repo: openwisp/openwisp-wifi-login-pages PR: 1063
File: client/components/status/status.test.js:2890-2916
Timestamp: 2026-03-18T17:34:09.903Z
Learning: Do not rely on mocking or altering window.location in Jest/JSDOM for this project. Since window.location is non-configurable in the test environment and attempts to redefine or delete it can cause state leaks across tests, avoid hacks like delete window.location or Object.defineProperty(window, 'location', ...) in tests. Instead, migrate detection-related tests to React Testing Library (RTL) and use RTL-friendly patterns (e.g., render components and inspect behavior via UI, or mock network/detection logic with explicit dependency injection or module mocks). This pattern should apply to all test files under client/components (any .test.js) where window.location might be interacted with.

Applied to files:

  • client/components/contact-box/contact.test.js
🔇 Additional comments (2)
client/components/contact-box/contact.test.js (1)

15-19: LGTM! Mock data structure is correct.

The test mock properly includes the css property that the component expects. However, note that the actual configuration in organizations/default/default.yml is missing this property (see review comment for that file).

organizations/default/default.yml (1)

163-165: The X social link configuration is correct as-is.

The login component does not use a css property. It applies a hardcoded className of "social-link button full" to all social links. The X link entry contains all required properties (text, icon, and url) that the login component actually expects.

			> Likely an incorrect or invalid review comment.

Comment thread organizations/default/default.yml
@openwisp-companion
Copy link
Copy Markdown

Code Style Failure

Hello @Ayush4958,
(Analysis for commit 942604f)

  • Code Style: Prettier found code style issues in client/components/contact-box/contact.test.js. Please run openwisp-qa-format to automatically fix these issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[bug] Old Twitter Image is Being Used

2 participants