Skip to content

Fix show total when total domain is not set - #39

Merged
ecarreras merged 1 commit into
mainfrom
80812/fix-show-total
Nov 24, 2025
Merged

ecarreras merged 1 commit into
mainfrom
80812/fix-show-total

Conversation

@ecarreras

@ecarreras ecarreras commented Nov 24, 2025 •

Copy link
Copy Markdown
Member

This pull request updates the logic for the showTotal property in indicator graphs so that it defaults to True only when a totalDomain is defined, and to False otherwise. The changes ensure consistent behavior and update the corresponding tests to reflect this new default.

Logic changes

  • Changed the default value for showTotal in ooui/graph/indicator.py to be True only if totalDomain is defined, otherwise False. Previously, it always defaulted to True regardless of totalDomain.

Test updates

  • Updated tests in spec/graph/graph_spec.py to expect showTotal to be False when totalDomain is not present, and True when it is present. Added new test cases for both scenarios. [1] [2]
  • Improved tests to always check for the presence of showTotal in the response, and verify its value matches the new logic depending on the presence of totalDomain.
  • Updated processor tests in spec/graph/processor_spec.py to expect showTotal=False when totalDomain is not defined and showTotal=True when it is defined. [1] [2]

- Add showTotal attribute to GraphIndicator class
- showTotal defaults to True only when totalDomain is defined, otherwise False
- Always include showTotal in response with correct boolean value
- Add comprehensive tests for showTotal functionality in both graph_spec.py and processor_spec.py
- Ensure logical behavior: only show total when totalDomain exists
@ecarreras ecarreras self-assigned this Nov 24, 2025
@ecarreras ecarreras changed the title Add showTotal attribute to GraphIndicator Fix show total when total domain is not set Nov 24, 2025
@ecarreras ecarreras added the patch Create a Patch version label Nov 24, 2025
@ecarreras
ecarreras merged commit 862931f into main Nov 24, 2025
1 check passed
@ecarreras
ecarreras deleted the 80812/fix-show-total branch November 24, 2025 12:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

patch Create a Patch version

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant