(03-5301 )-fix failing test expectation in queue-table.test.tsx#2183
(03-5301 )-fix failing test expectation in queue-table.test.tsx#2183bhavya-jpg wants to merge 1 commit intoopenmrs:mainfrom
Conversation
|
@gitcliff Hi ,can I please get a review on this |
|
@bhavya-jpg have you seen the E2E test failure ? |
BlessedAmrita
left a comment
There was a problem hiding this comment.
Hi @bhavya-jpg , thanks for contributing!
Could you please update the description to follow the standard PR template? This will make the PR look much cleaner for the maintainers.
jayasanka-sack
left a comment
There was a problem hiding this comment.
Good catch @bhavya-jpg!
Could you also update the other two places in the same test file where the incorrect UUID is used? Even though those tests don’t currently rely on the value fixing it now will help avoid mysteries later if someone extends or modifies them.
Also, could you please follow the conventional PR title format outlined in the PR template? I noticed the template content was removed in this one. Going forward it would be great to stick to the template.
Keep up the good work!
|
@jayasanka-sack thank you for the review on this ,ill surely look into this and try and update the other two places in the same test file and surely I'll rewrite my pr msg to match the format . |
Fix Broken Queue Table Test Expectation
Problem Statement
The queue-table.test.tsx file contained a skipped test expectation marked with a TODO. The test intended to verify that the "Queue Number" column correctly renders the visit attribute, but it was failing and thus commented out. This left a gap in test coverage for the queue table's rendering logic.
Summary:
Solution: This PR enables and fixes the failing test case in packages/esm-service-queues-app/src/queue-table/queue-table.test.tsx. It corrects the test configuration to match the mock data and refactors the row selection logic to be more robust.
Key Changes:
Test Configuration Fix:
Updated visitQueueNumberAttributeUuid in the test config to use the Attribute Type UUID (queue-number-visit-attr-type-uuid) instead of the Instance UUID. This matches the structure in queue-entry.mock.ts
, allowing the component to correctly find the attribute.
Robust Row Selection:
Refactored Row Selector: Changed the test to find the row by patient name (getByText('Alice Johnson')) instead of using a hardcoded index (rows[2]).
Why: The previous index rows[2] incorrectly targeted a hidden "expansion row" (due to Carbon Design System's table structure), which caused the test to read undefined cells. The new selection logic is robust and correctly identifies the visible row.
Enabled Test:
Uncommented the expectation expect(cells[1].childNodes[0]).toHaveTextContent('42'); to verify the fix and ensure future regressions are caught.
Screenshots

Related Issue
https://openmrs.atlassian.net/browse/O3-5301
Other
Impact: Improves codebase health by resolving tech debt (TODOs) and ensuring accurate test coverage.
Testing: Verified that the specific test suite (
src/queue-table/queue-table.test.tsx
) passes successfully.