-
Notifications
You must be signed in to change notification settings - Fork 4
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
Refactor /patients/sidebar/flow-sidebar.js
tests for json api
#1302
Conversation
WalkthroughThe recent updates enhance the testing process for flow sidebar functionalities by introducing new helper functions for generating test data and adding two new team resources for testing. These modifications lead to cleaner, more maintainable code and improve the dynamic handling of entity relationships while preserving existing functionalities. Changes
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configuration File (
|
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.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (2)
- test/integration/patients/sidebar/flow-sidebar.js (18 hunks)
- test/support/api/teams.js (1 hunks)
Additional comments not posted (7)
test/support/api/teams.js (1)
53-54
: New team resources added for testing.The addition of
teamPhysician
andteamSupervisor
expands the testing capabilities. The changes are consistent with existing patterns.test/integration/patients/sidebar/flow-sidebar.js (6)
9-15
: Improved test data creation with helper functions.The introduction of helper functions like
getFlow
,getProgram
,getPatient
, andgetActions
simplifies test data creation, enhancing maintainability and readability.
20-39
: Dynamic handling of relationships in test data.The use of
getRelationship
to dynamically link relationships improves the robustness of the tests, ensuring they accurately reflect the application's data structure.
51-64
: Flexible API intercepts with dynamic IDs.Updating intercepts to use dynamic IDs of created flows instead of hardcoded values enhances test flexibility and adaptability.
575-580
: Refactored clinician setup with dynamic relationships.The use of
getCurrentClinician
with dynamic relationships improves the setup for tests involving clinicians, ensuring consistency and accuracy.
679-684
: Enhanced team management test setup.The setup for testing team management permissions is improved with dynamic relationships, ensuring the tests accurately reflect team interactions.
815-820
: Refactored flow setup for authored delete permissions.The refactored setup for testing flow permissions using dynamic relationships enhances the accuracy and reliability of the tests.
RoundingWell Care Ops Frontend
|
Project |
RoundingWell Care Ops Frontend
|
Branch Review |
refactor-flow-sidebar
|
Run status |
|
Run duration | 10m 59s |
Commit |
|
Committer | Nick Major |
View all properties for this run ↗︎ |
Test results | |
---|---|
|
0
|
|
0
|
|
0
|
|
0
|
|
304
|
View all changes introduced in this branch ↗︎ |
test/support/api/teams.js
Outdated
@@ -50,6 +50,8 @@ export function getTeams({ attributes, relationships, meta } = {}, { depth = 0 } | |||
// Exporting only teams needed for testing variance | |||
export const teamCoordinator = getTeamResource({ id: '11111' }); | |||
export const teamNurse = getTeamResource({ id: '22222' }); | |||
export const teamPhysician = getTeamResource({ id: '44444' }); |
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.
do we need to add two more or can we use the three we have?
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.
Yep, I've removed these 👍
99427a5
to
1808bf3
Compare
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.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- test/integration/patients/sidebar/flow-sidebar.js (19 hunks)
Files skipped from review as they are similar to previous changes (1)
- test/integration/patients/sidebar/flow-sidebar.js
Shortcut Story ID: [sc-54208]
Summary by CodeRabbit
New Features
teamPhysician
,teamSupervisor
) for more diverse testing scenarios.Bug Fixes
Documentation