-
Notifications
You must be signed in to change notification settings - Fork 17
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
Cu 86bznypcf notifications end to end testing #287
base: dev
Are you sure you want to change the base?
Conversation
…ations-End-To-End-Testing
Task linked: CU-86bznypcf Notifications-End-To-End-Testing |
WalkthroughThis update enhances the JeMPI UI application by introducing comprehensive Cypress testing capabilities for both end-to-end and component testing. New configuration files and test files validate the functionality of critical components like the Dashboard and NotificationWorklist. Additionally, adjustments to component structures improve accessibility and testability. These enhancements significantly boost test coverage, ensuring a more robust and reliable user experience. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant Cypress
participant Dashboard
participant NotificationWorklist
User->>Cypress: Initiates testing
Cypress->>Dashboard: Loads Dashboard tests
Dashboard->>Cypress: Validates dashboard functionalities
Cypress->>NotificationWorklist: Loads Notification tests
NotificationWorklist->>Cypress: Validates notifications functionalities
Cypress->>User: Returns test results
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: 1
Outside diff range, codebase verification and nitpick comments (1)
JeMPI_Apps/JeMPI_UI/cypress/support/component.ts (1)
38-39
: Example Usage Comment: No Issues FoundThe example usage comment is helpful for developers to understand how to use the custom
mount
command.Consider adding more detailed examples or links to documentation for further guidance.
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files ignored due to path filters (2)
JeMPI_Apps/JeMPI_UI/package-lock.json
is excluded by!**/package-lock.json
JeMPI_Apps/JeMPI_UI/yarn.lock
is excluded by!**/yarn.lock
,!**/*.lock
Files selected for processing (16)
- JeMPI_Apps/JeMPI_UI/cypress.config.ts (1 hunks)
- JeMPI_Apps/JeMPI_UI/cypress/e2e/dashboard.cy.ts (1 hunks)
- JeMPI_Apps/JeMPI_UI/cypress/e2e/mock_notifications.cy.ts (1 hunks)
- JeMPI_Apps/JeMPI_UI/cypress/e2e/notifications.cy.ts (1 hunks)
- JeMPI_Apps/JeMPI_UI/cypress/fixtures/example.json (1 hunks)
- JeMPI_Apps/JeMPI_UI/cypress/fixtures/notifications.json (1 hunks)
- JeMPI_Apps/JeMPI_UI/cypress/support/commands.ts (1 hunks)
- JeMPI_Apps/JeMPI_UI/cypress/support/component-index.html (1 hunks)
- JeMPI_Apps/JeMPI_UI/cypress/support/component.ts (1 hunks)
- JeMPI_Apps/JeMPI_UI/cypress/support/e2e.ts (1 hunks)
- JeMPI_Apps/JeMPI_UI/cypress/ts.config.json (1 hunks)
- JeMPI_Apps/JeMPI_UI/package.json (3 hunks)
- JeMPI_Apps/JeMPI_UI/src/components/dashboard/Dashboard.tsx (1 hunks)
- JeMPI_Apps/JeMPI_UI/src/components/notificationWorklist/NotificationWorklist.tsx (1 hunks)
- JeMPI_Apps/JeMPI_UI/src/components/shell/PageHeader.tsx (1 hunks)
- JeMPI_Apps/JeMPI_UI/tsconfig.json (1 hunks)
Files skipped from review due to trivial changes (7)
- JeMPI_Apps/JeMPI_UI/cypress/fixtures/example.json
- JeMPI_Apps/JeMPI_UI/cypress/support/component-index.html
- JeMPI_Apps/JeMPI_UI/cypress/support/e2e.ts
- JeMPI_Apps/JeMPI_UI/cypress/ts.config.json
- JeMPI_Apps/JeMPI_UI/src/components/dashboard/Dashboard.tsx
- JeMPI_Apps/JeMPI_UI/src/components/notificationWorklist/NotificationWorklist.tsx
- JeMPI_Apps/JeMPI_UI/src/components/shell/PageHeader.tsx
Additional context used
Biome
JeMPI_Apps/JeMPI_UI/cypress/e2e/mock_notifications.cy.ts
[error] 2-2: Don't focus the test.
The 'only' method is often used for debugging or during implementation. It should be removed before deploying to production.
Consider removing 'only' to ensure all tests are executed.
Unsafe fix: Remove focus from test.(lint/suspicious/noFocusedTests)
Additional comments not posted (41)
JeMPI_Apps/JeMPI_UI/cypress.config.ts (3)
4-4
: LGTM!The
projectId
setting is correct.
6-6
: LGTM!The
baseUrl
setting is correct.
7-9
: Placeholder comment noted.The
setupNodeEvents
function is currently a placeholder. Ensure to implement the necessary node event listeners as needed.JeMPI_Apps/JeMPI_UI/tsconfig.json (4)
22-22
: LGTM!The
paths
setting is correct and improves type resolution for Cypress-related files.
29-29
: LGTM!The
types
setting is correct and improves type safety and autocompletion for Cypress testing.
30-30
: LGTM!The
include
setting is correct and broadens the scope of files considered for compilation.
31-34
: LGTM!The
exclude
setting is correct and helps streamline the build process.JeMPI_Apps/JeMPI_UI/cypress/support/component.ts (3)
1-13
: Boilerplate Code: No Issues FoundThe initial comments provide useful information about the file's purpose and configuration options. This is standard boilerplate code provided by Cypress.
16-20
: Import Commands: No Issues FoundThe file imports custom commands using ES2015 syntax and provides an alternative CommonJS syntax. This is a standard practice.
22-37
: Extending Cypress with Custom Commands: No Issues FoundThe code extends the Cypress namespace to include type definitions for a custom
mount
command and adds the command. This is a standard way to augment Cypress functionality for React component testing.JeMPI_Apps/JeMPI_UI/cypress/support/commands.ts (3)
1-10
: Boilerplate Code: No Issues FoundThe initial comments provide useful information about the file's purpose and configuration options. This is standard boilerplate code provided by Cypress.
13-26
: Custom Commands Examples: No Issues FoundThe file includes commented-out examples of how to add various types of custom commands in Cypress. This is standard practice and provides a good starting point for developers.
28-37
: TypeScript Definitions: No Issues FoundThe file includes commented-out TypeScript definitions for custom commands. This is useful for TypeScript users and follows best practices.
JeMPI_Apps/JeMPI_UI/cypress/e2e/notifications.cy.ts (5)
1-4
: Setup for NotificationWorklist Tests: No Issues FoundThe
beforeEach
hook visits the/notifications
page before each test. This is a standard setup for end-to-end tests.
6-10
: Page Header Test: No Issues FoundThe test checks if the page header is displayed correctly. This is a basic but necessary test to ensure the UI is rendering as expected.
12-42
: Filters Tests: No Issues FoundThe tests check the visibility and functionality of various filters on the page. These tests are well-structured and cover essential aspects of the filter functionality.
45-53
: Data Grid Tests: No Issues FoundThe tests check the visibility of the data grid and pagination. These tests ensure that the main components of the notification worklist are displayed correctly.
56-67
: API Calls Tests: No Issues FoundThe tests intercept API calls and mock responses to ensure the component handles data correctly. This is a good practice for testing components that rely on external data.
JeMPI_Apps/JeMPI_UI/cypress/e2e/dashboard.cy.ts (6)
6-8
: LGTM!The test case correctly verifies the visibility of the dashboard tabs.
10-24
: LGTM!The test case comprehensively verifies the navigation through multiple tabs and their visibility.
26-33
: LGTM!The test case correctly verifies the visibility of specific widgets within the Confusion Matrix tab.
35-40
: LGTM!The test case correctly verifies the visibility of the M & U widget within the M & U Values tab.
43-63
: LGTM!The test case comprehensively verifies the correct rendering of the page with no data.
65-84
: LGTM!The test cases comprehensively verify the correct handling of loading state and API errors.
JeMPI_Apps/JeMPI_UI/package.json (5)
19-19
: LGTM!The reformatting of the
mock:enviroments
script does not impact its functionality.
20-20
: LGTM!The addition of the
cypress
script enhances the testing capabilities by integrating Cypress.
64-64
: LGTM!The update to
@testing-library/jest-dom
enhances the testing library with new features or fixes.
66-66
: LGTM!The update to
@types/jest
enhances the type definitions with improvements.
72-72
: LGTM!The addition of Cypress enhances the end-to-end testing capabilities.
JeMPI_Apps/JeMPI_UI/cypress/fixtures/notifications.json (12)
2-16
: LGTM!The data entry for the notification with ID
5407f4b6-504d-479e-9da1-b509b4b08b8f
appears to be complete and correct.
17-27
: LGTM!The data entry for the notification with ID
8d7a5e0c-14a0-4cd5-8b7e-875da3560501
appears to be complete and correct.
29-44
: LGTM!The data entry for the notification with ID
51f1c2c2-318f-41fc-a77b-7e1ac32668dc
appears to be complete and correct.
46-56
: LGTM!The data entry for the notification with ID
d16d8354-41c3-47af-a0aa-d80555654f4e
appears to be complete and correct.
58-68
: LGTM!The data entry for the notification with ID
ef0819bf-e32d-46dd-a074-c82f01a2ef00
appears to be complete and correct.
70-80
: LGTM!The data entry for the notification with ID
e605293e-64ed-4f9a-9b2f-866ecb150448
appears to be complete and correct.
82-97
: LGTM!The data entry for the notification with ID
927c7b9b-3457-48a0-97ff-a54d7d1c2e21
appears to be complete and correct.
99-109
: LGTM!The data entry for the notification with ID
84d6adae-4f21-4114-9c2a-e2c3a668c73d
appears to be complete and correct.
111-126
: LGTM!The data entry for the notification with ID
56bc8096-53d8-4c6c-8f99-1d2865240e62
appears to be complete and correct.
128-139
: LGTM!The data entry for the notification with ID
29c60b55-3500-40d2-8c0c-967171ed69d2
appears to be complete and correct.
141-150
: LGTM!The data entry for the notification with ID
7f61a925-7871-434a-987a-b1a76fed3eb3
appears to be complete and correct.
153-167
: LGTM!The data entry for the notification with ID
60aa1cc1-d7a6-46a2-b610-4da4a75f6742
appears to be complete and correct.
@@ -0,0 +1,8 @@ | |||
describe('it mocks fetch notifications',()=>{ | |||
it.only('checks api call', () => { |
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.
Remove it.only
to ensure all tests are executed.
The it.only
method is often used for debugging or during implementation. It should be removed before deploying to production to ensure that all tests are executed.
- it.only('checks api call', () => {
+ it('checks api call', () => {
Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
it.only('checks api call', () => { | |
it('checks api call', () => { |
Tools
Biome
[error] 2-2: Don't focus the test.
The 'only' method is often used for debugging or during implementation. It should be removed before deploying to production.
Consider removing 'only' to ensure all tests are executed.
Unsafe fix: Remove focus from test.(lint/suspicious/noFocusedTests)
Task linked: CU-86bznvd1v Dashboard-End-To-End-Testing |
…End-Testing' into CU-86bznypcf_Notifications-End-To-End-Testing # Conflicts: # JeMPI_Apps/JeMPI_UI/package-lock.json # JeMPI_Apps/JeMPI_UI/tsconfig.json # JeMPI_Apps/JeMPI_UI/yarn.lock
…-To-End-Testing' into CU-86bznypcf_Notifications-End-To-End-Testing
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 (3)
- JeMPI_Apps/JeMPI_AsyncReceiver/src/main/java/org/jembi/jempi/async_receiver/Main.java (1 hunks)
- JeMPI_Apps/JeMPI_Linker/src/main/java/org/jembi/jempi/linker/SPInteractions.java (1 hunks)
- JeMPI_Apps/JeMPI_UI/cypress/e2e/notifications.cy.ts (1 hunks)
Files skipped from review as they are similar to previous changes (1)
- JeMPI_Apps/JeMPI_UI/cypress/e2e/notifications.cy.ts
Additional comments not posted (5)
JeMPI_Apps/JeMPI_Linker/src/main/java/org/jembi/jempi/linker/SPInteractions.java (1)
98-98
: LGTM! Enhanced reliability with exactly-once processing.The addition of
StreamsConfig.PROCESSING_GUARANTEE_CONFIG
withStreamsConfig.EXACTLY_ONCE_V2
enhances the reliability of message processing by ensuring that records are neither lost nor processed more than once. This aligns with best practices for stateful stream processing.JeMPI_Apps/JeMPI_AsyncReceiver/src/main/java/org/jembi/jempi/async_receiver/Main.java (4)
167-167
: LGTM! Improved flexibility in partitionKey initialization.Initializing
partitionKey
as an empty string allows for a more flexible and inclusive way of constructing thepartitionKey
.
169-170
: LGTM! Enhanced partitionKey uniqueness with givenName.Concatenating the Soundex value of
givenName
if it is not empty enhances the uniqueness of thepartitionKey
.
171-172
: LGTM! Enhanced partitionKey uniqueness with familyName.Concatenating the Soundex value of
familyName
if it is not empty further enhances the uniqueness of thepartitionKey
.
174-175
: LGTM! Handling empty names in partitionKey.Appending "Unknown" to
partitionKey
when bothgivenName
andfamilyName
are empty ensures that thepartitionKey
is not left empty.
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 (8)
- JeMPI_Apps/JeMPI_UI/cypress.config.ts (1 hunks)
- JeMPI_Apps/JeMPI_UI/cypress/e2e/browseRecords.cy.ts (1 hunks)
- JeMPI_Apps/JeMPI_UI/cypress/e2e/dashboard.cy.ts (1 hunks)
- JeMPI_Apps/JeMPI_UI/cypress/e2e/notifications.cy.ts (1 hunks)
- JeMPI_Apps/JeMPI_UI/cypress/fixtures/searchResponse.json (1 hunks)
- JeMPI_Apps/JeMPI_UI/cypress/ts.config.json (1 hunks)
- JeMPI_Apps/JeMPI_UI/src/components/browseRecords/BrowseRecords.tsx (4 hunks)
- JeMPI_Apps/JeMPI_UI/src/components/notificationWorklist/NotificationWorklist.tsx (2 hunks)
Files skipped from review due to trivial changes (2)
- JeMPI_Apps/JeMPI_UI/cypress.config.ts
- JeMPI_Apps/JeMPI_UI/cypress/ts.config.json
Files skipped from review as they are similar to previous changes (3)
- JeMPI_Apps/JeMPI_UI/cypress/e2e/dashboard.cy.ts
- JeMPI_Apps/JeMPI_UI/cypress/e2e/notifications.cy.ts
- JeMPI_Apps/JeMPI_UI/src/components/notificationWorklist/NotificationWorklist.tsx
Additional comments not posted (12)
JeMPI_Apps/JeMPI_UI/cypress/e2e/browseRecords.cy.ts (7)
3-8
: Good use ofbeforeEach
hook.The
beforeEach
hook ensures that each test starts with a clean state by visiting the specified URL.
10-12
: Good use of a helper function.The
openRecordDetails
function improves reusability and readability by abstracting the action of opening record details.
14-18
: Good test for page header visibility.The test ensures that the page header is displayed correctly.
20-51
: Comprehensive tests for filter functionality.The tests ensure that the filter accordion can be expanded, collapsed, and that specific filters are visible.
54-63
: Effective tests for search results and navigation.The tests ensure that search results are displayed correctly and that navigation to record details works as expected.
65-109
: Comprehensive tests for record details page functionality.The tests ensure that navigation, visibility of tables, and button functionalities work as expected.
112-124
: Good test for API call interception.The test ensures that search results are displayed correctly when API calls are intercepted.
JeMPI_Apps/JeMPI_UI/src/components/browseRecords/BrowseRecords.tsx (4)
51-51
: Good addition of import statement.The import statement for
CustomTextField
reflects the integration of a custom text field component.
Line range hint
66-70
:
Good use ofuseState
hooks for date filters.The
useState
hooks manage the state for the start and end date filters.
233-245
: ImprovedDateTimePicker
components.The
DateTimePicker
components now use theslots
prop and integrate theCustomTextField
component, improving flexibility and consistency.
259-260
: Improved accessibility withid
attribute.Adding an
id
to theFormControlLabel
for the interactions switch improves accessibility.JeMPI_Apps/JeMPI_UI/cypress/fixtures/searchResponse.json (1)
1-963
: Well-organized JSON structure.The JSON file contains an array of
goldenRecord
objects, each with nestedsourceId
,uniqueGoldenRecordData
,demographicData
, andinteractionsWithScore
. The structure is consistent and well-organized.
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 (3)
- JeMPI_Apps/JeMPI_UI/src/test/settings/BlockingContent.test.tsx (1 hunks)
- JeMPI_Apps/JeMPI_UI/src/test/settings/Probabilistic.test.tsx (1 hunks)
- JeMPI_Apps/JeMPI_UI/src/test/settings/SourceView.test.tsx (1 hunks)
Files skipped from review due to trivial changes (3)
- JeMPI_Apps/JeMPI_UI/src/test/settings/BlockingContent.test.tsx
- JeMPI_Apps/JeMPI_UI/src/test/settings/Probabilistic.test.tsx
- JeMPI_Apps/JeMPI_UI/src/test/settings/SourceView.test.tsx
1. Description of changes
updated ts-config file
created notifications.cy.ts file
added tests
2.How to test
npm run cypress
select end-to-end-testing
Summary by CodeRabbit
New Features
BrowseRecords
component with improved date picker functionality and standardized UI elements.Bug Fixes
Chores