OpenSearch-Dashboards
OpenSearch-Dashboards copied to clipboard
[Multiple Datasource Test]Add test for toast button and validation form
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
β 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.
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.
Test error is not related to the code change in this PR
lint checker failure will be fixed by https://github.com/opensearch-project/OpenSearch-Dashboards/pull/6771