-
Notifications
You must be signed in to change notification settings - Fork 177
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add E2E tests to the enviroment (#1810)
* Add the test environment * Add the first functional test * Add two services to test the visualizations * Add two tests for the alerts visualizations * Refactoring and cleaning code * Create two new services to test pie charts * Create two tests for charts pie * should top 5 agent chart pie values are correct * should top 5 rule groups chart pie values are correct * Add test and fix sort problem * should alerts evolution - top 5 agents chart values are correct * Add the missing ID property * Fix problem with the sort function * Add two classes to test visualization tables * Add new test for alert summary table `should alerts summary table values are correct` * Refactoring duplicate code in `setTodayRange` * Add 14 tests to cover query bar and filters * should `alertStats` values are correct when add the filter ` rule.level: 7` * should `alert level evolution` chart values are correct when add the filter ` rule.level: 7` * should `alert` chart values are correct when add the filter ` rule.level: 7` * should `top 5 agent` chart pie values are correct when add the filter ` rule.level: 7` * should `top 5 rule groups` chart pie values are correct when add the filter ` rule.level: 7` * should `alerts evolution - top 5 agents` chart values are correct when add the filter ` rule.level: 7` * should `alerts summary` table values are correct when add the filter ` rule.level: 7` * should `alertStats` values are correct when add to the query bar ` rule.level: 7` * should `alert level evolution` chart values are correct when add to the query bar ` rule.level: 7` * should `alert` chart values are correct when add to the query bar ` rule.level: 7` * should `top 5 agent` chart pie values are correct when add to the query bar ` rule.level: 7` * should `top 5 rule groups` chart pie values are correct when add to the query bar ` rule.level: 7` * should `alerts evolution - top 5 agents` chart values are correct when add to the query bar ` rule.level: 7` * should `alerts summary` table values are correct when add to the query bar ` rule.level: 7` * Fix the problem with summary alerts test * Fix expect problem with alert summary table * Change the value of a param in visualization The aggregation type of the visualization is `sum` I change the value to `count` * Add missing id properties to visualizations * Create a new method to navigate to the FIM view * Add a `beforeEach` method to remove duplicate code * Add the tests for FIM Dashboard * Add test for the filters and query bar in FIM * Add documentation to the code * Fix problem when comparing objects * Set index pattern * Fix the problem with the expected test result * Removed discover from wz-menu
- Loading branch information
1 parent
04b6265
commit 15a0ef4
Showing
23 changed files
with
3,229 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/* | ||
* Wazuh app - Strings tools class | ||
* Copyright (C) 2015-2019 Wazuh, Inc. | ||
* | ||
* This program is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation; either version 2 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* Find more information about this on the LICENSE file. | ||
*/ | ||
|
||
export class StringsTools { | ||
constructor () {} | ||
/** | ||
* Set the first letter to upper case | ||
* | ||
* @param {*} str | ||
* @returns capitalized str | ||
* @memberof StringsTools | ||
*/ | ||
capitalize (str) { | ||
return str[0].toUpperCase() + str.slice(1); | ||
} | ||
|
||
|
||
/** | ||
* Remove all white spaces from str | ||
* | ||
* @param {*} str | ||
* @returns striped str | ||
* @memberof StringsTools | ||
*/ | ||
strip (str) { | ||
return str.replace(/\s+/g, ''); | ||
} | ||
|
||
toUpperCamelCase (str) { | ||
const capitalizeStrs = str.split(' ').map((s) => this.capitalize(s)); | ||
return capitalizeStrs.join(''); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.