Skip to content

Conversation

@Nirbhay21
Copy link
Contributor

Description

Added tooltips for copy buttons and hide buttons

Checklist

  • Ran npx prettier --write . (for formatting)
  • Ran gofmt -w . (for Go backend)
  • Ran npm test (for JS/TS testing; note: some IndexedDB tests fail in Node environment, but app works in browser)
  • Added unit tests, if applicable
  • Verified all tests pass in browser
  • Updated documentation, if needed

Additional Notes

  • Tooltip uses TailwindCSS classes for transition, positioning, and arrow display.
  • Tested locally in browser.

And i dont wanted to change,

  • backend/go.mod
  • frontend/package-lock.json

It automatically changed when i setup project locally.

@Nirbhay21 Nirbhay21 closed this Nov 5, 2025
@Nirbhay21 Nirbhay21 reopened this Nov 5, 2025
@Nirbhay21 Nirbhay21 closed this Nov 5, 2025
@Nirbhay21 Nirbhay21 reopened this Nov 5, 2025
Copy link
Contributor Author

@Nirbhay21 Nirbhay21 left a comment

Choose a reason for hiding this comment

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

I have reverted those two files to it's original state

@Nirbhay21 Nirbhay21 closed this Nov 5, 2025
@Nirbhay21 Nirbhay21 reopened this Nov 5, 2025
Copy link
Contributor Author

@Nirbhay21 Nirbhay21 left a comment

Choose a reason for hiding this comment

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

Also runned "npx prettier --write ."

@ShivaGupta-14
Copy link
Contributor

@Nirbhay21 It looks like the checks are failing during npm test.
You can click on the Frontend / prettier (pull_request), to view the detailed logs - that should help identify what’s causing it. 😊

@Nirbhay21
Copy link
Contributor Author

@Nirbhay21 It looks like the checks are failing during npm test. You can click on the Frontend / prettier (pull_request), to view the detailed logs - that should help identify what’s causing it. 😊

It checked it it shows this -

Failure summary
Job 54648777455 fails 1 test: src/components/HomeComponents/SetupGuide/tests/CopyableCode.test.tsx
Root cause: the test clicks a "copy" icon but in the test environment (jsdom) navigator.clipboard.writeText is not implemented, so the component never resolves the clipboard promise and toast.success is not called — waitFor times out. The logs show the wait-for timeout (checkRealTimersCallback / jsdom Window).

Quick fix (recommended)
Mock navigator.clipboard.writeText in the test (or in Jest global setup) so the copy action resolves and toast.success runs.
This is the least invasive fix and keeps tests deterministic.

Should I do this quick fix by updating test ?

@ShivaGupta-14
Copy link
Contributor

@Nirbhay21 Thanks for checking! From the logs it seems like the issue is with navigator.clipboard.writeText not being implemented in jsdom.
Mocking it in the test (as suggested in the quick fix) should likely resolve the timeout.
Maybe you can try adding that mock in the test file or Jest setup and see if the checks pass?

@ShivaGupta-14
Copy link
Contributor

Also, you can try running npm test locally before committing, it helps catch these issues earlier.

@its-me-abhishek
Copy link
Collaborator

@Nirbhay21 i'd suggest just mock that function in the test file and check if it works, similar to

beforeAll(() => {
  window.prompt = jest.fn();
});

@Nirbhay21
Copy link
Contributor Author

@Nirbhay21 i'd suggest just mock that function in the test file and check if it works, similar to

beforeAll(() => {
  window.prompt = jest.fn();
});

Ok

@Nirbhay21 Nirbhay21 closed this Nov 6, 2025
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.

Add tooltips for a better UI

3 participants