Skip to content

e2e: Add test for testing wallet name editing#459

Open
Abhay349 wants to merge 1 commit intocaravan-bitcoin:mainfrom
Abhay349:add-test
Open

e2e: Add test for testing wallet name editing#459
Abhay349 wants to merge 1 commit intocaravan-bitcoin:mainfrom
Abhay349:add-test

Conversation

@Abhay349
Copy link

What kind of change does this PR introduce?

  • Test improvement / E2E test coverage

Issue Number:

Fixes #442

If relevant, did you update the documentation?

  • Not applicable (test-only change)

Summary

This PR adds an end-to-end test to cover the wallet name editing functionality in the Caravan coordinator.

Previously, editing and saving a wallet name was not covered by E2E tests. This change ensures that:

  • A loaded wallet can enter edit mode
  • The wallet name can be updated and saved
  • The updated name is correctly reflected in the UI

The test follows the existing E2E test structure and error-handling conventions and runs as part of the full coordinator E2E suite.

Does this PR introduce a breaking change?

  • No

Checklist

  • I have tested my changes thoroughly.
  • I have added or updated tests to cover my changes (if applicable).
  • I have verified that test coverage meets or exceeds 95% (if applicable).
  • I have run the test suite locally, and all tests pass.
  • I have written tests for all new changes/features
  • I have followed the project's coding style and conventions.
  • I have created a changeset to document my changes (npm run changeset).

Other information

  • The test handles Playwright strict mode by scoping locators where multiple elements share the same data-cy attributes.
  • All coordinator E2E tests pass locally using Docker-based setup.

Have you read the contributing guide?

  • Yes

@changeset-bot
Copy link

changeset-bot bot commented Jan 26, 2026

⚠️ No Changeset found

Latest commit: 47ec0ee

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@vercel
Copy link

vercel bot commented Jan 26, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
caravan-coordinator Ready Ready Preview, Comment Feb 18, 2026 2:26am

Request Review

Copy link
Contributor

@Legend101Zz Legend101Zz left a comment

Choose a reason for hiding this comment

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

Thanks for the PR , overall looks good , just a couple of reviews

await nameInput.fill(newName);

// Save change
await page.locator('[data-cy="save-button"]').click();
Copy link
Contributor

Choose a reason for hiding this comment

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

question here , will this create a race condition ? like after clicking save, there's no guarantee the save operation has completed right or does playwright handle this ?

Copy link
Author

Choose a reason for hiding this comment

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

I agree, there is a chance of a race condition if we don’t wait for the UI to update. While playwright ensures that the click itself is safe, it doesn’t automatically guarantee that the underlying save operation has completed.

To make this more reliable, I’ll update the test to explicitly wait for the updated wallet name to appear and for the edit mode to close. This way, the test only proceeds once the save is actually reflected in the UI.

@Abhay349
Copy link
Author

Hi @Legend101Zz I have updated the test to address the race condition and kept it focused on validating the user-visible behavior only. The test now checks that the wallet name updates correctly in the UI and that the UI exits edit mode after saving.
I have also updated the inline comments to better explain the intent behind each assertion.
Screenshot 2026-02-11 at 07 48 29
All tests are passing.
Let me know if there issues, happy to iterate on further feedback.
Thanks :)

Copy link
Contributor

@Legend101Zz Legend101Zz left a comment

Choose a reason for hiding this comment

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

@Abhay349 thanks for bearing with me and all the changes .. I am approving this PR for @bucko13 's review :)

@Abhay349
Copy link
Author

@Legend101Zz ~Thanks


// Wallet name should be visible (display mode)
let nameDisplay = page.locator('[data-cy="editable-name-value"]').first();
await expect(nameDisplay).toBeVisible({ timeout: 15000 });
Copy link
Contributor

Choose a reason for hiding this comment

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

these are some really long timeouts. Do we really expect it could take up to 15 seconds for the field to become visible?

Copy link
Contributor

Choose a reason for hiding this comment

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

Ok, it seems this is a sane default, but I think we could avoid having to write this every time by adding this to the main config instead. what do you think?

Copy link
Author

@Abhay349 Abhay349 Feb 18, 2026

Choose a reason for hiding this comment

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

@bucko13 Thanks for the review and feedback, that makes sense. I have increased the timeout to 15s to reduce potential flakiness, taking cues from some existing tests. That said, I agree it’s better not to repeat this inline. I’ll move it to the main Playwright config.

Copy link
Author

Choose a reason for hiding this comment

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

And I'm happy to modify existing tests based on feedback.
Thanks :)

throw new Error(`Error in wallet name editing: ${error}`);
}
});
}); No newline at end of file
Copy link
Contributor

Choose a reason for hiding this comment

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

new line at end of file.

Signed-off-by: Abhay349 <pandeyabhay967@gmail.com>
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.

End-to-End Testing Coverage

3 participants