-
Notifications
You must be signed in to change notification settings - Fork 85
Increase unit test coverage for new request manager page #7165
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Increase unit test coverage for new request manager page #7165
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
Greptile SummaryThis PR adds comprehensive unit test coverage for the PrivacyRequestFiltersBar and ListItem components in the new request manager dashboard. The tests use well-designed mocks for ESM-only packages and provide good coverage of standard filtering workflows, custom field handling, and component rendering. Key Coverage Areas:
Issues Found:
Confidence Score: 3/5
Important Files Changed
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2 files reviewed, 1 comment
clients/admin-ui/src/features/privacy-requests/dashboard/PrivacyRequestFiltersBar.test.tsx
Show resolved
Hide resolved
…s-bar' of github.com:ethyca/fides into ENG-1626-Add-unit-test-coverage-for-new-privacy-request-ui
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2 files reviewed, 2 comments
| describe("Copy functionality", () => { | ||
| it("should render copy tooltips for identities", () => { | ||
| const request = createMockRequest({ | ||
| identity: { | ||
| email: { label: "Email", value: "user@example.com" }, | ||
| phone_number: { label: "Phone", value: "+1234567890" }, | ||
| }, | ||
| }); | ||
|
|
||
| render(<ListItem item={request} />); | ||
|
|
||
| // Check that phone number identity with copy functionality is rendered | ||
| expect(screen.getByText("+1234567890")).toBeInTheDocument(); | ||
| expect(screen.getByText("Phone:")).toBeInTheDocument(); | ||
| }); | ||
|
|
||
| it("should render copy tooltip for request ID", () => { | ||
| render(<ListItem item={baseRequest} />); | ||
|
|
||
| // The request ID should be rendered with CopyTooltip | ||
| const requestIdElements = screen.getAllByText("pri_123"); | ||
| expect(requestIdElements.length).toBeGreaterThan(0); | ||
| }); | ||
| }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logic: The "Copy functionality" test section sets up a mocked clipboard API but doesn't test actual copy operations. The PR description claims "Tests clipboard copy operations via mouse click and keyboard (Enter key) with tooltip feedback," but these tests only verify that elements render. The clipboard mock (lines 96-102) is unused. Consider adding tests that:
- Simulate clicks on copy-enabled text and verify
navigator.clipboard.writeText()was called - Test keyboard interaction (Enter key) if the CopyTooltip component supports it
- Verify the copy tooltip appears/hides as expected
Without these assertions, the copy functionality isn't actually validated.
clients/admin-ui/src/features/privacy-requests/dashboard/PrivacyRequestFiltersBar.test.tsx
Show resolved
Hide resolved
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
…s-bar' of github.com:ethyca/fides into ENG-1626-Add-unit-test-coverage-for-new-privacy-request-ui
…s-bar' of github.com:ethyca/fides into ENG-1626-Add-unit-test-coverage-for-new-privacy-request-ui
d925568 to
4ed4343
Compare
Co-authored-by: Jason Gill <jason.gill@ethyca.com>
…s-bar' of github.com:ethyca/fides into ENG-1626-Add-unit-test-coverage-for-new-privacy-request-ui
…s-bar' of github.com:ethyca/fides into ENG-1626-Add-unit-test-coverage-for-new-privacy-request-ui
jpople
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice, I like the approach here and love to see some component tests. Looking good!
…etter-debounce-to-text-input-on-filters-bar
…s-bar' of github.com:ethyca/fides into ENG-1626-Add-unit-test-coverage-for-new-privacy-request-ui
Ticket ENG-1626
Description Of Changes
Increases unit test coverage in the new request manager page components. Complemented with cypress tests here and unit tests here
PrivacyRequestFiltersBar Tests
ListItem Tests
Code Changes
Steps to Confirm
Pre-Merge Checklist
CHANGELOG.mdupdatedmaindowngrade()migration is correct and works