-
Notifications
You must be signed in to change notification settings - Fork 441
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
Fix: Spo2 twice rendering and wrong thresholds #9182
base: develop
Are you sure you want to change the base?
Fix: Spo2 twice rendering and wrong thresholds #9182
Conversation
WalkthroughThe changes in Changes
Assessment against linked issues
Possibly related issues
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
Warning There were issues while running some tools. Please review the errors and either fix the tool’s configuration or disable the tool if it’s a critical failure. 🔧 eslint (1.23.1)
src/components/Patient/DailyRounds.tsxOops! Something went wrong! :( ESLint: 8.57.1 Error: Failed to load parser '@typescript-eslint/parser' declared in '.eslintrc.json': Cannot find module '@typescript-eslint/parser'
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
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 using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
✅ Deploy Preview for care-ohc ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
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
🧹 Outside diff range and nitpick comments (1)
cypress/pageobject/Patient/PatientLogupdate.ts (1)
66-66
: Consider adding test coverage for different round types.Since the PR fixes SpO2 field behavior across different round types, consider enhancing the test coverage.
Add test cases like:
// Example test structure describe('SpO2 field behavior', () => { const roundTypes = ['Nurse Log Update', 'Doctor Log Update', 'Other Type']; roundTypes.forEach(roundType => { it(`correctly handles SpO2 input for ${roundType}`, () => { // Setup patientLogUpdate.selectRoundType(roundType); // Test SpO2 input patientLogUpdate.typeSpo2('98'); // Verify cy.get('#ventilator_spo2').should('have.value', '98'); }); }); });
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (1)
cypress/pageobject/Patient/PatientLogupdate.ts
(1 hunks)
🔇 Additional comments (1)
cypress/pageobject/Patient/PatientLogupdate.ts (1)
66-66
: LGTM! Implementation aligns with UI changes.
The change from direct typing to using typeAndSelectOption
correctly reflects the UI update where SpO2 is now consistently implemented as a RangeAutocompleteFormField.
Let's verify the custom command implementation:
✅ Verification successful
Custom command typeAndSelectOption
is properly implemented and widely used
The command is correctly implemented in cypress/support/commands.ts
and is being used consistently across multiple page objects for handling autocomplete fields. The implementation properly handles clicking, typing, and selecting from dropdown options, which aligns with the SPO2 field's new behavior.
- Command implementation found in
cypress/support/commands.ts
:
Cypress.Commands.add(
"typeAndSelectOption",
(element: string, referance: string) => {
cy.get(element)
.click()
.type(referance)
.then(() => {
cy.get("[role='option']").contains(referance).click();
});
},
);
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Verify the custom command implementation
# Expected: Find the implementation of typeAndSelectOption command
# Search for the custom command definition
rg -A 5 "Cypress.Commands.add.*typeAndSelectOption"
Length of output: 53
Script:
#!/bin/bash
# Let's try different search patterns and locations to find the custom command
# Search for typeAndSelectOption in cypress/support directory (common location for custom commands)
echo "=== Searching in cypress/support ==="
fd . "cypress/support" --type f --exec cat {}
# Search for any file containing typeAndSelectOption
echo -e "\n=== Searching for typeAndSelectOption usage ==="
rg "typeAndSelectOption" --type ts
Length of output: 11166
Proposed Changes
@ohcnetwork/care-fe-code-reviewers
@Jacobjeevan
Merge Checklist
Summary by CodeRabbit
New Features
ventilator_spo2
input field to a number type with defined min/max values (0 to 100).ventilator_spo2
based on severity levels using dynamic translations.Bug Fixes
ventilator_spo2
field based on selectedrounds_type
.