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

workflow_detail unit tests #345

Merged
merged 14 commits into from
Sep 6, 2024
Merged

Conversation

saimedhi
Copy link
Collaborator

@saimedhi saimedhi commented Sep 4, 2024

Description

  • Added workflow_detail unit tests.
  • Tests added for the following workflow types : "Custom", "Semantic search", "Hybrid search"

Issues Resolved

Related to #95

Check List

  • New functionality includes testing.
    • All tests pass
  • New functionality has been documented.
  • Commits are signed per the DCO using --signoff

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

Signed-off-by: saimedhi <[email protected]>
test/utils.ts Outdated Show resolved Hide resolved
@saimedhi saimedhi marked this pull request as draft September 5, 2024 01:34
test/utils.ts Outdated Show resolved Hide resolved
@saimedhi saimedhi marked this pull request as ready for review September 5, 2024 21:28
test/utils.ts Outdated Show resolved Hide resolved
@saimedhi saimedhi marked this pull request as draft September 6, 2024 15:53
saimedhi and others added 2 commits September 6, 2024 10:51
@saimedhi saimedhi marked this pull request as ready for review September 6, 2024 18:11
return <WorkflowDetail setActionMenu={jest.fn()} {...props} />;
}}
/>
<Redirect from="/" to={`/workflow/${workflowId}`} />
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wondering why we need this redirect? Can't we specify the path directly on line 44?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • @ohltyler, Removed Redirect and instead adding initialEntries within the history.
  • And also below path should not be removed. Whenever URL matches the below pattern then workflowId will be dynamically obtained from URL. Similar to the actual use case of workflowDetail Component.
    path="/workflow/:workflowId"

@ohltyler
Copy link
Member

ohltyler commented Sep 6, 2024

LGTM on those checks. But to complete the basic UT, we should check any general functionality based on the scope of each component as well. Some things I can think of:

  1. Clicking the "close" button goes back to the list page
  2. Clicking the "export" button opens the export component
  3. Collapsing the panels (the "Tools" panel or form panel) should hide those components
  4. The default components in the ReactFlow workspace (the visual preview) are visible
  5. The "Create an ingest pipeline" option is selected by default
  6. The "Run ingestion" button is enabled by default
  7. The "Search pipeline >" button is disabled by default
  8. The error state of the page (e.g., can't find workflow due to backend issues / invalid ID etc.) renders when triggered (see source code)

Overall, I'd recommend playing around with each page and trying to cover more basic expectations, besides strictly reading for text fields being visible.

You can refer to the detector list test suite in AD for some detailed examples. I don't think we need to start this extreme, but should check that the base functionality is there across the whole page.

Copy link
Member

@ohltyler ohltyler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These can be covered in a followup PR

saimedhi and others added 2 commits September 6, 2024 12:34
@saimedhi saimedhi merged commit afb45d6 into opensearch-project:main Sep 6, 2024
6 checks passed
opensearch-trigger-bot bot pushed a commit that referenced this pull request Sep 6, 2024
* workflow_detail tests

Signed-off-by: saimedhi <[email protected]>

* workflow_detail tests

Signed-off-by: saimedhi <[email protected]>

* workflow_detail tests

Signed-off-by: saimedhi <[email protected]>

* workflow_detail tests

Signed-off-by: saimedhi <[email protected]>

* workflow_detail tests

Signed-off-by: saimedhi <[email protected]>

* workflow_detail tests

Signed-off-by: saimedhi <[email protected]>

* workflow_detail tests

Signed-off-by: saimedhi <[email protected]>

* workflow_detail tests

Signed-off-by: saimedhi <[email protected]>

---------

Signed-off-by: saimedhi <[email protected]>
(cherry picked from commit afb45d6)
ohltyler pushed a commit that referenced this pull request Sep 6, 2024
Signed-off-by: saimedhi <[email protected]>
(cherry picked from commit afb45d6)

Co-authored-by: Sai Medhini Reddy Maryada <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants