Skip to content
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

[#12588] Part of Improve test code coverage of core components #13189

Open
wants to merge 11 commits into
base: master
Choose a base branch
from

Conversation

Surge747
Copy link

@Surge747 Surge747 commented Oct 20, 2024

100% coverage on RichTextEditorComponent
and improves coverage on SessionsTable

Part of #12588

Outline of Solution

SessionTables improved coverage (PublishStatusTooltipPipe and SessionsTableComponent) (70.3% -> 100%)
Adds test cases for unexpected input (e.g., invalid and undefined statuses).
Improves test readability by using clear and meaningful variable names.
Reduces redundant setup code with a beforeEach block.
Ensures the code is more robust and resilient to edge cases, improving maintainability and reliability.

RichTextEditorComponent improved coverage (30%->100%)
The tests now verify all possible input properties (isDisabled, hasCharacterLimit, minHeightInPx, placeholderText, and richText) and ensure that custom values are correctly applied.
Added tests to simulate character count updates, keypress prevention, and content truncation for paste events.
Used a mock TinyMCE editor to closely mimic real editor behavior.
A MockRange class was introduced to accurately simulate Range objects, ensuring realistic cursor manipulation tests.
The setup function of TinyMCE was invoked manually, allowing detailed verification of event listeners (GetContent, keypress, paste).
Test functions were refactored with clearer naming conventions and logically grouped by feature (e.g., "Input Properties," "Output Events," "Character Limit Functionality").
setTimeout and done callbacks were used to ensure asynchronous actions (like setTimeout) are fully tested.

100% coverage on RichTextEditorComponent
and improves coverage on SessionsTable
Copy link

Hi @Surge747, thank you for your interest in contributing to TEAMMATES!
However, your PR does not appear to follow our contribution guidelines:

  • Description must reference the issue number the PR is fixing, e.g. Fixes #<issue-number> (or Part of #<issue-number> if the PR does not address the issue fully)

Please address the above before we proceed to review your PR.

100% coverage on RichTextEditorComponent
and 100% coverage in sessions-table.component.spec.ts
100% coverage on RichTextEditorComponent
and 100% coverage in sessions-table.component.spec.ts
The myth of Sisyphus
Updated sessions-table.component.spec.ts to have 100% coverage
Updated sessions-table.component.spec.ts to have 100% coverage
MaY tHe GiT gOds bE meRcIfUl
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant