Skip to content

fix: domain in cookie list not update when be set to empty#8683

Merged
ZxBing0066 merged 3 commits into
developfrom
fix/cookie-list-domain-not-update
May 8, 2025
Merged

fix: domain in cookie list not update when be set to empty#8683
ZxBing0066 merged 3 commits into
developfrom
fix/cookie-list-domain-not-update

Conversation

@ZxBing0066
Copy link
Copy Markdown
Member

@ZxBing0066 ZxBing0066 commented May 7, 2025

Issue

INS-5474

The Domain in the cookie list is not updated when it's set to empty

Kapture.2025-05-07.at.13.23.10.mp4

Changes

  • Set renderedText state to empty in RenderedTextInternal when children is a false value
  • Add tests

@ZxBing0066 ZxBing0066 requested review from a team and Copilot May 7, 2025 05:27
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes a bug where the cookie's Domain field does not update when set to an empty value.

  • Resets the RenderedTextInternal state when children is falsy to correctly update the cookie domain display.
  • Adds a data-testid attribute to the cookie domain element in the cookies modal.
  • Introduces new smoke tests to verify the cookie update behavior.

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
packages/insomnia/src/ui/components/rendered-text.tsx Resets renderedText and error state when no children are provided, ensuring that an empty domain is correctly rendered.
packages/insomnia/src/ui/components/modals/cookies-modal.tsx Adds a data-testid attribute to the span wrapping the RenderedText component to facilitate targeted testing.
packages/insomnia-smoke-test/tests/smoke/cookie-editor-interactions.test.ts Adds new tests to verify that setting a cookie domain to empty and reassigning it correctly updates the UI.

Comment thread packages/insomnia/src/ui/components/rendered-text.tsx
@ZxBing0066 ZxBing0066 marked this pull request as ready for review May 7, 2025 05:42
@ZxBing0066 ZxBing0066 enabled auto-merge (squash) May 8, 2025 02:02
@ZxBing0066 ZxBing0066 merged commit e62917a into develop May 8, 2025
10 checks passed
@ZxBing0066 ZxBing0066 deleted the fix/cookie-list-domain-not-update branch May 8, 2025 02:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants