OpenSearch-Dashboards icon indicating copy to clipboard operation
OpenSearch-Dashboards copied to clipboard

[Multiple Datasource Test]Add test for toast button and validation form

Open yujin-emma opened this issue 9 months ago β€’ 3 comments

Description

Issues Resolved

Screenshot

Testing the changes

 PASS  src/plugins/data_source_management/public/components/validation/datasource_form_validation.test.ts (5.056 s)
  DataSourceManagement: Form Validation
    validate create/edit datasource for Username and Password auth type
      βœ“ should fail validation when title is empty (2 ms)
      βœ“ should fail validation on duplicate title
      βœ“ should fail validation when title is longer than 32 characters (1 ms)
      βœ“ should fail validation when endpoint is not valid (1 ms)
      βœ“ should fail validation when username is empty
      βœ“ should fail validation when password is empty
      βœ“ should NOT fail validation on empty username/password when  No Auth is selected (1 ms)
      βœ“ should NOT fail validation on all fields (1 ms)
      βœ“ should NOT fail validation when registered auth type is selected and related credential field not empty (1 ms)
    validate create/edit datasource for SigV4 auth type
      βœ“ should fail validation when title is empty
      βœ“ should fail validation on duplicate title
      βœ“ should fail validation when title is longer than 32 characters (1 ms)
      βœ“ should fail validation when endpoint is not valid
      βœ“ should fail validation when accesskey is empty
      βœ“ should fail validation when secrectKey is empty (1 ms)
      βœ“ should NOT fail validation on empty accesskey/secretKey when  No Auth is selected
      βœ“ should NOT fail validation on all fields
      βœ“ should NOT fail validation when registered auth type is selected and related credential field not empty (1 ms)


 PASS  src/plugins/data_source_management/public/components/toast_button/manage_data_source_button.test.tsx
  ManageDataSourceButton
    βœ“ renders without crashing (18 ms)
    βœ“ renders a button with correct label (7 ms)
    βœ“ navigates to management app on button click (7 ms)

 PASS  src/plugins/data_source_management/public/components/toast_button/reload_button.test.tsx
  getReloadButton
    βœ“ renders button with correct label (23 ms)
    βœ“ calls window.location.reload() on button click (14 ms)


Changelog

  • fix: Add test for toast button and validation form

Check List

  • [ ] All tests pass
    • [ ] yarn test:jest
    • [ ] yarn test:jest_integration
  • [ ] New functionality includes testing.
  • [ ] New functionality has been documented.
  • [ ] Update CHANGELOG.md
  • [ ] Commits are signed per the DCO using --signoff

yujin-emma avatar May 09 '24 00:05 yujin-emma

❌ Empty Changelog Section

The Changelog section in your PR description is empty. Please add a valid changelog entry or entries. If you did add a changelog entry, check to make sure that it was not accidentally included inside the comment block in the Changelog section.

github-actions[bot] avatar May 09 '24 00:05 github-actions[bot]

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 67.57%. Comparing base (bd62a5d) to head (64c00d2).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6755      +/-   ##
==========================================
+ Coverage   67.55%   67.57%   +0.02%     
==========================================
  Files        3428     3428              
  Lines       67340    67340              
  Branches    10994    10994              
==========================================
+ Hits        45492    45506      +14     
+ Misses      19178    19164      -14     
  Partials     2670     2670              
Flag Coverage Ξ”
Linux_1 33.04% <ΓΈ> (ΓΈ)
Linux_2 55.13% <ΓΈ> (ΓΈ)
Linux_3 45.17% <ΓΈ> (+0.01%) :arrow_up:
Linux_4 34.73% <ΓΈ> (ΓΈ)
Windows_1 33.09% <ΓΈ> (+0.02%) :arrow_up:
Windows_2 55.10% <ΓΈ> (ΓΈ)
Windows_3 45.17% <ΓΈ> (+<0.01%) :arrow_up:
Windows_4 34.73% <ΓΈ> (ΓΈ)

Flags with carried forward coverage won't be shown. Click here to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar May 09 '24 00:05 codecov[bot]

Test error is not related to the code change in this PR

yujin-emma avatar May 09 '24 17:05 yujin-emma

lint checker failure will be fixed by https://github.com/opensearch-project/OpenSearch-Dashboards/pull/6771

yujin-emma avatar May 13 '24 21:05 yujin-emma