diff --git a/src/gmp/commands/__tests__/auditreport.js b/src/gmp/commands/__tests__/auditreport.js
index ce7091ee06..086368b6ba 100644
--- a/src/gmp/commands/__tests__/auditreport.js
+++ b/src/gmp/commands/__tests__/auditreport.js
@@ -15,6 +15,7 @@
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see .
*/
+import {describe, test, expect} from '@gsa/testing';
import {createHttp, createEntityResponse} from 'gmp/commands/testing';
import {AuditReportCommand} from 'gmp/commands/auditreports';
diff --git a/src/gmp/commands/__tests__/auditreports.js b/src/gmp/commands/__tests__/auditreports.js
index d6fdb42885..4b710fac71 100644
--- a/src/gmp/commands/__tests__/auditreports.js
+++ b/src/gmp/commands/__tests__/auditreports.js
@@ -15,6 +15,7 @@
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see .
*/
+import {describe, test, expect} from '@gsa/testing';
import {ALL_FILTER} from 'gmp/models/filter';
import {
diff --git a/src/web/components/powerfilter/__tests__/compliancelevelsgroup.jsx b/src/web/components/powerfilter/__tests__/compliancelevelsgroup.jsx
index 9ba081fb1a..d8431e1ba1 100644
--- a/src/web/components/powerfilter/__tests__/compliancelevelsgroup.jsx
+++ b/src/web/components/powerfilter/__tests__/compliancelevelsgroup.jsx
@@ -15,6 +15,7 @@
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see .
*/
+import {describe, test, expect, testing} from '@gsa/testing';
import {render, fireEvent} from 'web/utils/testing';
import ComplianceLevelsFilterGroup from 'web/components/powerfilter/compliancelevelsgroup';
@@ -24,8 +25,8 @@ import Filter from 'gmp/models/filter';
describe('ComplianceLevelsFilterGroup audit reports tests', () => {
test('should call change handler', () => {
const filter = Filter.fromString('report_compliance_levels=');
- const handleChange = vi.fn();
- const handleRemove = vi.fn();
+ const handleChange = testing.fn();
+ const handleRemove = testing.fn();
const {element} = render(
{
test('should check checkbox', () => {
const filter = Filter.fromString('report_compliance_levels=yn');
- const handleChange = vi.fn();
- const handleRemove = vi.fn();
+ const handleChange = testing.fn();
+ const handleRemove = testing.fn();
const {element} = render(
{
test('should uncheck checkbox', () => {
const filter1 = Filter.fromString('report_compliance_levels=yni');
const filter2 = Filter.fromString('report_compliance_levels=yn');
- const handleChange = vi.fn();
- const handleRemove = vi.fn();
+ const handleChange = testing.fn();
+ const handleRemove = testing.fn();
const {element, rerender} = render(
{
test('should be unchecked by default', () => {
const filter = Filter.fromString();
- const handleChange = vi.fn();
- const handleRemove = vi.fn();
+ const handleChange = testing.fn();
+ const handleRemove = testing.fn();
const {element} = render(
{
test('should call remove handler', () => {
const filter = Filter.fromString('report_compliance_levels=y');
- const handleChange = vi.fn();
- const handleRemove = vi.fn();
+ const handleChange = testing.fn();
+ const handleRemove = testing.fn();
const {element} = render(
{
describe('ComplianceLevelsFilterGroup audit results tests', () => {
test('should call change handler', () => {
const filter = Filter.fromString('compliance_levels=');
- const handleChange = vi.fn();
- const handleRemove = vi.fn();
+ const handleChange = testing.fn();
+ const handleRemove = testing.fn();
const {element} = render(
{
test('should check checkbox', () => {
const filter = Filter.fromString('compliance_levels=yn');
- const handleChange = vi.fn();
- const handleRemove = vi.fn();
+ const handleChange = testing.fn();
+ const handleRemove = testing.fn();
const {element} = render(
{
test('should uncheck checkbox', () => {
const filter1 = Filter.fromString('compliance_levels=yni');
const filter2 = Filter.fromString('compliance_levels=yn');
- const handleChange = vi.fn();
- const handleRemove = vi.fn();
+ const handleChange = testing.fn();
+ const handleRemove = testing.fn();
const {element, rerender} = render(
{
test('should be unchecked by default', () => {
const filter = Filter.fromString();
- const handleChange = vi.fn();
- const handleRemove = vi.fn();
+ const handleChange = testing.fn();
+ const handleRemove = testing.fn();
const {element} = render(
{
test('should call remove handler', () => {
const filter = Filter.fromString('compliance_levels=y');
- const handleChange = vi.fn();
- const handleRemove = vi.fn();
+ const handleChange = testing.fn();
+ const handleRemove = testing.fn();
const {element} = render(
.
*/
+import {describe, test, expect, testing} from '@gsa/testing';
import React from 'react';
import Capabilities from 'gmp/capabilities/capabilities';
@@ -46,37 +47,37 @@ const caps = new Capabilities(['everything']);
const manualUrl = 'test/';
-const currentSettings = vi.fn().mockResolvedValue({
+const currentSettings = testing.fn().mockResolvedValue({
foo: 'bar',
});
-const getReportComposerDefaults = vi.fn().mockResolvedValue({
+const getReportComposerDefaults = testing.fn().mockResolvedValue({
foo: 'bar',
});
describe('Audit Detla Report Details Content tests', () => {
test('should render Audit Delta Report Details Content', () => {
- const onActivateTab = vi.fn();
- const onAddToAssetsClick = vi.fn();
- const onError = vi.fn();
- const onFilterAddLogLevelClick = vi.fn();
- const onFilterDecreaseMinQoDClick = vi.fn();
- const onFilterChanged = vi.fn();
- const onFilterCreated = vi.fn();
- const onFilterEditClick = vi.fn();
- const onFilterRemoveSeverityClick = vi.fn();
- const onFilterResetClick = vi.fn();
- const onFilterRemoveClick = vi.fn();
- const onInteraction = vi.fn();
- const onRemoveFromAssetsClick = vi.fn();
- const onReportDownloadClick = vi.fn();
- const showError = vi.fn();
- const showErrorMessage = vi.fn();
- const showSuccessMessage = vi.fn();
- const onSortChange = vi.fn();
- const onTagSuccess = vi.fn();
- const onTargetEditClick = vi.fn();
- const onTlsCertificateDownloadClick = vi.fn();
+ const onActivateTab = testing.fn();
+ const onAddToAssetsClick = testing.fn();
+ const onError = testing.fn();
+ const onFilterAddLogLevelClick = testing.fn();
+ const onFilterDecreaseMinQoDClick = testing.fn();
+ const onFilterChanged = testing.fn();
+ const onFilterCreated = testing.fn();
+ const onFilterEditClick = testing.fn();
+ const onFilterRemoveSeverityClick = testing.fn();
+ const onFilterResetClick = testing.fn();
+ const onFilterRemoveClick = testing.fn();
+ const onInteraction = testing.fn();
+ const onRemoveFromAssetsClick = testing.fn();
+ const onReportDownloadClick = testing.fn();
+ const showError = testing.fn();
+ const showErrorMessage = testing.fn();
+ const showSuccessMessage = testing.fn();
+ const onSortChange = testing.fn();
+ const onTagSuccess = testing.fn();
+ const onTargetEditClick = testing.fn();
+ const onTlsCertificateDownloadClick = testing.fn();
const sorting = {
errors: {sortField: 'error', sortReverse: true},
@@ -227,27 +228,27 @@ describe('Audit Detla Report Details Content tests', () => {
});
test('should render results tab', () => {
- const onActivateTab = vi.fn();
- const onAddToAssetsClick = vi.fn();
- const onError = vi.fn();
- const onFilterAddLogLevelClick = vi.fn();
- const onFilterDecreaseMinQoDClick = vi.fn();
- const onFilterChanged = vi.fn();
- const onFilterCreated = vi.fn();
- const onFilterEditClick = vi.fn();
- const onFilterRemoveSeverityClick = vi.fn();
- const onFilterResetClick = vi.fn();
- const onFilterRemoveClick = vi.fn();
- const onInteraction = vi.fn();
- const onRemoveFromAssetsClick = vi.fn();
- const onReportDownloadClick = vi.fn();
- const showError = vi.fn();
- const showErrorMessage = vi.fn();
- const showSuccessMessage = vi.fn();
- const onSortChange = vi.fn();
- const onTagSuccess = vi.fn();
- const onTargetEditClick = vi.fn();
- const onTlsCertificateDownloadClick = vi.fn();
+ const onActivateTab = testing.fn();
+ const onAddToAssetsClick = testing.fn();
+ const onError = testing.fn();
+ const onFilterAddLogLevelClick = testing.fn();
+ const onFilterDecreaseMinQoDClick = testing.fn();
+ const onFilterChanged = testing.fn();
+ const onFilterCreated = testing.fn();
+ const onFilterEditClick = testing.fn();
+ const onFilterRemoveSeverityClick = testing.fn();
+ const onFilterResetClick = testing.fn();
+ const onFilterRemoveClick = testing.fn();
+ const onInteraction = testing.fn();
+ const onRemoveFromAssetsClick = testing.fn();
+ const onReportDownloadClick = testing.fn();
+ const showError = testing.fn();
+ const showErrorMessage = testing.fn();
+ const showSuccessMessage = testing.fn();
+ const onSortChange = testing.fn();
+ const onTagSuccess = testing.fn();
+ const onTargetEditClick = testing.fn();
+ const onTlsCertificateDownloadClick = testing.fn();
const sorting = {
apps: {sortField: 'severity', sortReverse: true},
diff --git a/src/web/pages/reports/__tests__/auditdetailscontent.jsx b/src/web/pages/reports/__tests__/auditdetailscontent.jsx
index 6ee038f4ed..5a3487d00b 100644
--- a/src/web/pages/reports/__tests__/auditdetailscontent.jsx
+++ b/src/web/pages/reports/__tests__/auditdetailscontent.jsx
@@ -15,6 +15,7 @@
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see .
*/
+import {describe, test, expect, testing} from '@gsa/testing';
import React from 'react';
import Capabilities from 'gmp/capabilities/capabilities';
@@ -50,37 +51,37 @@ const caps = new Capabilities(['everything']);
const manualUrl = 'test/';
-const currentSettings = vi.fn().mockResolvedValue({
+const currentSettings = testing.fn().mockResolvedValue({
foo: 'bar',
});
-const getReportComposerDefaults = vi.fn().mockResolvedValue({
+const getReportComposerDefaults = testing.fn().mockResolvedValue({
foo: 'bar',
});
describe('Audit Report Details Content tests', () => {
test('should render Audit Report Details Content', () => {
- const onActivateTab = vi.fn();
- const onAddToAssetsClick = vi.fn();
- const onError = vi.fn();
- const onFilterAddLogLevelClick = vi.fn();
- const onFilterDecreaseMinQoDClick = vi.fn();
- const onFilterChanged = vi.fn();
- const onFilterCreated = vi.fn();
- const onFilterEditClick = vi.fn();
- const onFilterRemoveSeverityClick = vi.fn();
- const onFilterResetClick = vi.fn();
- const onFilterRemoveClick = vi.fn();
- const onInteraction = vi.fn();
- const onRemoveFromAssetsClick = vi.fn();
- const onReportDownloadClick = vi.fn();
- const showError = vi.fn();
- const showErrorMessage = vi.fn();
- const showSuccessMessage = vi.fn();
- const onSortChange = vi.fn();
- const onTagSuccess = vi.fn();
- const onTargetEditClick = vi.fn();
- const onTlsCertificateDownloadClick = vi.fn();
+ const onActivateTab = testing.fn();
+ const onAddToAssetsClick = testing.fn();
+ const onError = testing.fn();
+ const onFilterAddLogLevelClick = testing.fn();
+ const onFilterDecreaseMinQoDClick = testing.fn();
+ const onFilterChanged = testing.fn();
+ const onFilterCreated = testing.fn();
+ const onFilterEditClick = testing.fn();
+ const onFilterRemoveSeverityClick = testing.fn();
+ const onFilterResetClick = testing.fn();
+ const onFilterRemoveClick = testing.fn();
+ const onInteraction = testing.fn();
+ const onRemoveFromAssetsClick = testing.fn();
+ const onReportDownloadClick = testing.fn();
+ const showError = testing.fn();
+ const showErrorMessage = testing.fn();
+ const showSuccessMessage = testing.fn();
+ const onSortChange = testing.fn();
+ const onTagSuccess = testing.fn();
+ const onTargetEditClick = testing.fn();
+ const onTlsCertificateDownloadClick = testing.fn();
const sorting = {
errors: {sortField: 'error', sortReverse: true},
@@ -226,27 +227,27 @@ describe('Audit Report Details Content tests', () => {
});
test('should render audit threshold panel', () => {
- const onActivateTab = vi.fn();
- const onAddToAssetsClick = vi.fn();
- const onError = vi.fn();
- const onFilterAddLogLevelClick = vi.fn();
- const onFilterDecreaseMinQoDClick = vi.fn();
- const onFilterChanged = vi.fn();
- const onFilterCreated = vi.fn();
- const onFilterEditClick = vi.fn();
- const onFilterRemoveSeverityClick = vi.fn();
- const onFilterResetClick = vi.fn();
- const onFilterRemoveClick = vi.fn();
- const onInteraction = vi.fn();
- const onRemoveFromAssetsClick = vi.fn();
- const onReportDownloadClick = vi.fn();
- const showError = vi.fn();
- const showErrorMessage = vi.fn();
- const showSuccessMessage = vi.fn();
- const onSortChange = vi.fn();
- const onTagSuccess = vi.fn();
- const onTargetEditClick = vi.fn();
- const onTlsCertificateDownloadClick = vi.fn();
+ const onActivateTab = testing.fn();
+ const onAddToAssetsClick = testing.fn();
+ const onError = testing.fn();
+ const onFilterAddLogLevelClick = testing.fn();
+ const onFilterDecreaseMinQoDClick = testing.fn();
+ const onFilterChanged = testing.fn();
+ const onFilterCreated = testing.fn();
+ const onFilterEditClick = testing.fn();
+ const onFilterRemoveSeverityClick = testing.fn();
+ const onFilterResetClick = testing.fn();
+ const onFilterRemoveClick = testing.fn();
+ const onInteraction = testing.fn();
+ const onRemoveFromAssetsClick = testing.fn();
+ const onReportDownloadClick = testing.fn();
+ const showError = testing.fn();
+ const showErrorMessage = testing.fn();
+ const showSuccessMessage = testing.fn();
+ const onSortChange = testing.fn();
+ const onTagSuccess = testing.fn();
+ const onTargetEditClick = testing.fn();
+ const onTlsCertificateDownloadClick = testing.fn();
const sorting = {
errors: {sortField: 'error', sortReverse: true},
diff --git a/src/web/pages/reports/__tests__/auditfilterdialog.jsx b/src/web/pages/reports/__tests__/auditfilterdialog.jsx
index b0a63076a6..b0aa94ec7c 100644
--- a/src/web/pages/reports/__tests__/auditfilterdialog.jsx
+++ b/src/web/pages/reports/__tests__/auditfilterdialog.jsx
@@ -15,6 +15,7 @@
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see .
*/
+import {describe, test, expect, testing} from '@gsa/testing';
import React from 'react';
import Capabilities from 'gmp/capabilities/capabilities';
@@ -34,9 +35,9 @@ const manualUrl = 'test/';
describe('Filter Dialog for Audit report', () => {
test('should render filter with compliance level group', () => {
- const onFilterChanged = vi.fn();
- const onFilterCreated = vi.fn();
- const onCloseClick = vi.fn();
+ const onFilterChanged = testing.fn();
+ const onFilterCreated = testing.fn();
+ const onCloseClick = testing.fn();
const filter = Filter.fromString(
'apply_overrides=0 levels=hmlg rows=100 min_qod=70 first=1 sort=compliant',
diff --git a/src/web/pages/reports/__tests__/auditreportrow.jsx b/src/web/pages/reports/__tests__/auditreportrow.jsx
index c3ed9799ee..9cf3c6a0b5 100644
--- a/src/web/pages/reports/__tests__/auditreportrow.jsx
+++ b/src/web/pages/reports/__tests__/auditreportrow.jsx
@@ -15,7 +15,7 @@
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see .
*/
-
+import {describe, test, expect, testing} from '@gsa/testing';
import React from 'react';
import {rendererWith} from 'web/utils/testing';
import AuditRow from '../auditreportrow';
@@ -26,8 +26,8 @@ import {getMockAuditReport} from 'web/pages/reports/__mocks__/mockauditreport';
describe('Audit report row', () => {
test('should render row for Audit report', () => {
const {entity} = getMockAuditReport();
- const onReportDeleteClick = vi.fn();
- const onReportDeltaSelect = vi.fn();
+ const onReportDeleteClick = testing.fn();
+ const onReportDeltaSelect = testing.fn();
const {render, store} = rendererWith({
capabilities: true,
diff --git a/src/web/pages/reports/__tests__/auditreportslistpage.jsx b/src/web/pages/reports/__tests__/auditreportslistpage.jsx
index ca7ae301db..956df3e3d0 100644
--- a/src/web/pages/reports/__tests__/auditreportslistpage.jsx
+++ b/src/web/pages/reports/__tests__/auditreportslistpage.jsx
@@ -15,6 +15,7 @@
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see .
*/
+import {describe, test, expect, testing} from '@gsa/testing';
import React from 'react';
import {act} from 'react-dom/test-utils';
@@ -35,18 +36,18 @@ import AuditReportsPage from '../auditreportslistpage';
setLocale('en');
-window.URL.createObjectURL = vi.fn();
+window.URL.createObjectURL = testing.fn();
const {entity} = getMockAuditReport();
const reloadInterval = 1;
const manualUrl = 'test/';
-const currentSettings = vi.fn().mockResolvedValue({
+const currentSettings = testing.fn().mockResolvedValue({
foo: 'bar',
});
-const getFilters = vi.fn().mockReturnValue(
+const getFilters = testing.fn().mockReturnValue(
Promise.resolve({
data: [],
meta: {
@@ -56,7 +57,7 @@ const getFilters = vi.fn().mockReturnValue(
}),
);
-const getDashboardSetting = vi.fn().mockResolvedValue({
+const getDashboardSetting = testing.fn().mockResolvedValue({
data: [],
meta: {
filter: Filter.fromString(),
@@ -64,11 +65,11 @@ const getDashboardSetting = vi.fn().mockResolvedValue({
},
});
-const getUserSetting = vi.fn().mockResolvedValue({
+const getUserSetting = testing.fn().mockResolvedValue({
filter: null,
});
-const getComplianceAggregates = vi.fn().mockResolvedValue({
+const getComplianceAggregates = testing.fn().mockResolvedValue({
data: [],
meta: {
filter: Filter.fromString(),
@@ -76,7 +77,7 @@ const getComplianceAggregates = vi.fn().mockResolvedValue({
},
});
-const getReports = vi.fn().mockResolvedValue({
+const getReports = testing.fn().mockResolvedValue({
data: [entity],
meta: {
filter: Filter.fromString(),
@@ -84,7 +85,7 @@ const getReports = vi.fn().mockResolvedValue({
},
});
-const getAll = vi.fn().mockResolvedValue({
+const getAll = testing.fn().mockResolvedValue({
data: [],
meta: {
filter: Filter.fromString(),
@@ -92,7 +93,7 @@ const getAll = vi.fn().mockResolvedValue({
},
});
-const getReportFormats = vi.fn().mockResolvedValue({
+const getReportFormats = testing.fn().mockResolvedValue({
data: [],
meta: {
filter: Filter.fromString(),
@@ -202,11 +203,11 @@ describe('AuditReportsPage tests', () => {
});
test('should call commands for bulk actions', async () => {
- const deleteByFilter = vi.fn().mockResolvedValue({
+ const deleteByFilter = testing.fn().mockResolvedValue({
foo: 'bar',
});
- const exportByFilter = vi.fn().mockResolvedValue({
+ const exportByFilter = testing.fn().mockResolvedValue({
foo: 'bar',
});
diff --git a/src/web/pages/reports/__tests__/detailsfilterdialog.jsx b/src/web/pages/reports/__tests__/detailsfilterdialog.jsx
index 869afeef41..6c37670125 100644
--- a/src/web/pages/reports/__tests__/detailsfilterdialog.jsx
+++ b/src/web/pages/reports/__tests__/detailsfilterdialog.jsx
@@ -15,6 +15,7 @@
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see .
*/
+import {describe, test, expect, testing} from '@gsa/testing';
import React from 'react';
import Capabilities from 'gmp/capabilities/capabilities';
@@ -34,9 +35,9 @@ const manualUrl = 'test/';
describe('Details Filter Dialog for Audit report', () => {
test('should render compliance levels filter group', () => {
- const onFilterChanged = vi.fn();
- const onFilterCreated = vi.fn();
- const onCloseClick = vi.fn();
+ const onFilterChanged = testing.fn();
+ const onFilterCreated = testing.fn();
+ const onCloseClick = testing.fn();
const filter = Filter.fromString(
'apply_overrides=0 levels=hmlg rows=100 min_qod=70 first=1 sort=compliant',
@@ -82,9 +83,9 @@ describe('Details Filter Dialog for Audit report', () => {
});
test('should render severity levels filter group', () => {
- const onFilterChanged = vi.fn();
- const onFilterCreated = vi.fn();
- const onCloseClick = vi.fn();
+ const onFilterChanged = testing.fn();
+ const onFilterCreated = testing.fn();
+ const onCloseClick = testing.fn();
const filter = Filter.fromString(
'apply_overrides=0 levels=hmlg rows=100 min_qod=70 first=1 sort=severity',
diff --git a/src/web/pages/reports/details/__tests__/hoststab.jsx b/src/web/pages/reports/details/__tests__/hoststab.jsx
index 4a971b3360..c1e5fd96f9 100644
--- a/src/web/pages/reports/details/__tests__/hoststab.jsx
+++ b/src/web/pages/reports/details/__tests__/hoststab.jsx
@@ -136,8 +136,8 @@ describe('Audit Report Hosts Tab tests', () => {
test('should render Audit Report Hosts Tab', () => {
const {hosts} = getMockAuditReport();
- const onSortChange = vi.fn();
- const onInteraction = vi.fn();
+ const onSortChange = testing.fn();
+ const onInteraction = testing.fn();
const {render, store} = rendererWith({
gmp,
diff --git a/src/web/pages/reports/details/__tests__/operatingsystemstab.jsx b/src/web/pages/reports/details/__tests__/operatingsystemstab.jsx
index c14f08d24a..22ff44761e 100644
--- a/src/web/pages/reports/details/__tests__/operatingsystemstab.jsx
+++ b/src/web/pages/reports/details/__tests__/operatingsystemstab.jsx
@@ -117,8 +117,8 @@ describe('Audit Report Operating Systems Tab tests', () => {
test('should render Audit Report Operating Systems Tab', () => {
const {operatingsystems} = getMockAuditReport();
- const onSortChange = vi.fn();
- const onInteraction = vi.fn();
+ const onSortChange = testing.fn();
+ const onInteraction = testing.fn();
const {render, store} = rendererWith({
router: true,
diff --git a/src/web/pages/reports/details/__tests__/resultstab.jsx b/src/web/pages/reports/details/__tests__/resultstab.jsx
index 5983b729c6..7dbba97f56 100644
--- a/src/web/pages/reports/details/__tests__/resultstab.jsx
+++ b/src/web/pages/reports/details/__tests__/resultstab.jsx
@@ -15,6 +15,7 @@
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see .
*/
+import {describe, test, expect, testing} from '@gsa/testing';
import React from 'react';
import {setLocale} from 'gmp/locale/lang';
@@ -117,7 +118,7 @@ let getResults;
beforeEach(() => {
// mock gmp commands
- getResults = vi.fn().mockResolvedValue({
+ getResults = testing.fn().mockResolvedValue({
data: results,
meta: {
filter: Filter.fromString(),
@@ -125,7 +126,7 @@ beforeEach(() => {
},
});
- getFilters = vi.fn().mockReturnValue(
+ getFilters = testing.fn().mockReturnValue(
Promise.resolve({
data: [],
meta: {
@@ -135,7 +136,7 @@ beforeEach(() => {
}),
);
- getDashboardSetting = vi.fn().mockResolvedValue({
+ getDashboardSetting = testing.fn().mockResolvedValue({
data: [],
meta: {
filter: Filter.fromString(),
@@ -143,7 +144,7 @@ beforeEach(() => {
},
});
- getAggregates = vi.fn().mockResolvedValue({
+ getAggregates = testing.fn().mockResolvedValue({
data: [],
meta: {
filter: Filter.fromString(),
@@ -151,20 +152,20 @@ beforeEach(() => {
},
});
- currentSettings = vi.fn().mockResolvedValue({
+ currentSettings = testing.fn().mockResolvedValue({
foo: 'bar',
});
});
describe('Report Results Tab tests', () => {
test('should render Results Tab with compliance information', async () => {
- const reload = vi.fn();
- const onFilterAddLogLevelClick = vi.fn();
- const onFilterDecreaseMinQoDClick = vi.fn();
- const onFilterEditClick = vi.fn();
- const onFilterRemoveClick = vi.fn();
- const onFilterRemoveSeverityClick = vi.fn();
- const onTargetEditClick = vi.fn();
+ const reload = testing.fn();
+ const onFilterAddLogLevelClick = testing.fn();
+ const onFilterDecreaseMinQoDClick = testing.fn();
+ const onFilterEditClick = testing.fn();
+ const onFilterRemoveClick = testing.fn();
+ const onFilterRemoveSeverityClick = testing.fn();
+ const onTargetEditClick = testing.fn();
const gmp = {
results: {
@@ -270,13 +271,13 @@ describe('Report Results Tab tests', () => {
});
test('should render Results Tab with compliance information', async () => {
- const reload = vi.fn();
- const onFilterAddLogLevelClick = vi.fn();
- const onFilterDecreaseMinQoDClick = vi.fn();
- const onFilterEditClick = vi.fn();
- const onFilterRemoveClick = vi.fn();
- const onFilterRemoveSeverityClick = vi.fn();
- const onTargetEditClick = vi.fn();
+ const reload = testing.fn();
+ const onFilterAddLogLevelClick = testing.fn();
+ const onFilterDecreaseMinQoDClick = testing.fn();
+ const onFilterEditClick = testing.fn();
+ const onFilterRemoveClick = testing.fn();
+ const onFilterRemoveSeverityClick = testing.fn();
+ const onTargetEditClick = testing.fn();
const gmp = {
results: {
diff --git a/src/web/store/entities/report/__tests__/actions.js b/src/web/store/entities/report/__tests__/actions.js
index 4c4c6e7ebb..24ab556597 100644
--- a/src/web/store/entities/report/__tests__/actions.js
+++ b/src/web/store/entities/report/__tests__/actions.js
@@ -963,11 +963,11 @@ describe('loadAuditReport function tests', () => {
[id]: false,
},
});
- const getState = vi.fn().mockReturnValue(rootState);
+ const getState = testing.fn().mockReturnValue(rootState);
- const dispatch = vi.fn();
+ const dispatch = testing.fn();
- const get = vi.fn().mockResolvedValue({
+ const get = testing.fn().mockResolvedValue({
data: {foo: 'bar'},
});
@@ -1007,11 +1007,11 @@ describe('loadAuditReport function tests', () => {
[id]: false,
},
});
- const getState = vi.fn().mockReturnValue(rootState);
+ const getState = testing.fn().mockReturnValue(rootState);
- const dispatch = vi.fn();
+ const dispatch = testing.fn();
- const get = vi.fn().mockResolvedValue({
+ const get = testing.fn().mockResolvedValue({
data: {foo: 'bar'},
});
@@ -1056,11 +1056,11 @@ describe('loadAuditReport function tests', () => {
},
});
- const getState = vi.fn().mockReturnValue(rootState);
+ const getState = testing.fn().mockReturnValue(rootState);
- const dispatch = vi.fn();
+ const dispatch = testing.fn();
- const get = vi.fn().mockResolvedValue([{id: 'foo'}]);
+ const get = testing.fn().mockResolvedValue([{id: 'foo'}]);
const gmp = {
auditreport: {
@@ -1085,11 +1085,11 @@ describe('loadAuditReport function tests', () => {
},
});
- const getState = vi.fn().mockReturnValue(rootState);
+ const getState = testing.fn().mockReturnValue(rootState);
- const dispatch = vi.fn();
+ const dispatch = testing.fn();
- const get = vi.fn().mockRejectedValue('An Error');
+ const get = testing.fn().mockRejectedValue('An Error');
const gmp = {
auditreport: {
@@ -1126,11 +1126,11 @@ describe('report loadAuditReportIfNeeded function tests', () => {
[id]: false,
},
});
- const getState = vi.fn().mockReturnValue(rootState);
+ const getState = testing.fn().mockReturnValue(rootState);
- const dispatch = vi.fn();
+ const dispatch = testing.fn();
- const get = vi.fn().mockResolvedValue({data: {foo: 'bar'}});
+ const get = testing.fn().mockResolvedValue({data: {foo: 'bar'}});
const gmp = {
auditreport: {
@@ -1172,11 +1172,11 @@ describe('report loadAuditReportIfNeeded function tests', () => {
},
});
- const getState = vi.fn().mockReturnValue(rootState);
+ const getState = testing.fn().mockReturnValue(rootState);
- const dispatch = vi.fn();
+ const dispatch = testing.fn();
- const get = vi.fn().mockResolvedValue([{id: 'foo'}]);
+ const get = testing.fn().mockResolvedValue([{id: 'foo'}]);
const gmp = {
auditreport: {
@@ -1200,11 +1200,11 @@ describe('report loadAuditReportIfNeeded function tests', () => {
[id]: false,
},
});
- const getState = vi.fn().mockReturnValue(rootState);
+ const getState = testing.fn().mockReturnValue(rootState);
- const dispatch = vi.fn();
+ const dispatch = testing.fn();
- const get = vi.fn().mockResolvedValue({data: {foo: 'bar'}});
+ const get = testing.fn().mockResolvedValue({data: {foo: 'bar'}});
const gmp = {
auditreport: {
@@ -1249,11 +1249,11 @@ describe('report loadAuditReportIfNeeded function tests', () => {
},
});
- const getState = vi.fn().mockReturnValue(rootState);
+ const getState = testing.fn().mockReturnValue(rootState);
- const dispatch = vi.fn();
+ const dispatch = testing.fn();
- const get = vi.fn().mockResolvedValue([{id: 'foo'}]);
+ const get = testing.fn().mockResolvedValue([{id: 'foo'}]);
const gmp = {
auditreport: {
@@ -1278,11 +1278,11 @@ describe('report loadAuditReportIfNeeded function tests', () => {
},
});
- const getState = vi.fn().mockReturnValue(rootState);
+ const getState = testing.fn().mockReturnValue(rootState);
- const dispatch = vi.fn();
+ const dispatch = testing.fn();
- const get = vi.fn().mockRejectedValue('An Error');
+ const get = testing.fn().mockRejectedValue('An Error');
const gmp = {
auditreport: {
@@ -1323,9 +1323,9 @@ describe('loadAuditReportWithThreshold tests', () => {
[id]: false,
},
});
- const getState = vi.fn().mockReturnValue(rootState);
+ const getState = testing.fn().mockReturnValue(rootState);
- const dispatch = vi.fn();
+ const dispatch = testing.fn();
const auditreport = {
report: {
@@ -1337,7 +1337,7 @@ describe('loadAuditReportWithThreshold tests', () => {
},
};
- const get = vi.fn().mockResolvedValue({
+ const get = testing.fn().mockResolvedValue({
data: auditreport,
});
@@ -1382,9 +1382,9 @@ describe('loadAuditReportWithThreshold tests', () => {
[id]: false,
},
});
- const getState = vi.fn().mockReturnValue(rootState);
+ const getState = testing.fn().mockReturnValue(rootState);
- const dispatch = vi.fn();
+ const dispatch = testing.fn();
const auditreport = {
report: {
@@ -1396,7 +1396,7 @@ describe('loadAuditReportWithThreshold tests', () => {
},
};
- const get = vi.fn().mockResolvedValue({
+ const get = testing.fn().mockResolvedValue({
data: auditreport,
});
@@ -1463,9 +1463,9 @@ describe('loadAuditReportWithThreshold tests', () => {
[reportIdentifier(id, filter)]: false,
},
});
- const getState = vi.fn().mockReturnValue(rootState);
+ const getState = testing.fn().mockReturnValue(rootState);
- const dispatch = vi.fn();
+ const dispatch = testing.fn();
const auditreport = {
report: {
@@ -1477,7 +1477,7 @@ describe('loadAuditReportWithThreshold tests', () => {
},
};
- const get = vi.fn().mockResolvedValue({
+ const get = testing.fn().mockResolvedValue({
data: auditreport,
});
@@ -1526,9 +1526,9 @@ describe('loadAuditReportWithThreshold tests', () => {
[reportIdentifier(id, filter)]: false,
},
});
- const getState = vi.fn().mockReturnValue(rootState);
+ const getState = testing.fn().mockReturnValue(rootState);
- const dispatch = vi.fn();
+ const dispatch = testing.fn();
const auditreport = {
report: {
@@ -1540,7 +1540,7 @@ describe('loadAuditReportWithThreshold tests', () => {
},
};
- const get = vi.fn().mockResolvedValue({
+ const get = testing.fn().mockResolvedValue({
data: auditreport,
});
@@ -1603,9 +1603,9 @@ describe('loadAuditReportWithThreshold tests', () => {
[id]: true,
},
});
- const getState = vi.fn().mockReturnValue(rootState);
+ const getState = testing.fn().mockReturnValue(rootState);
- const dispatch = vi.fn();
+ const dispatch = testing.fn();
const auditreport = {
report: {
@@ -1617,7 +1617,7 @@ describe('loadAuditReportWithThreshold tests', () => {
},
};
- const get = vi.fn().mockResolvedValue({
+ const get = testing.fn().mockResolvedValue({
data: auditreport,
});
@@ -1652,9 +1652,9 @@ describe('loadAuditReportWithThreshold tests', () => {
[reportIdentifier(id, filter)]: true,
},
});
- const getState = vi.fn().mockReturnValue(rootState);
+ const getState = testing.fn().mockReturnValue(rootState);
- const dispatch = vi.fn();
+ const dispatch = testing.fn();
const auditreport = {
report: {
@@ -1666,7 +1666,7 @@ describe('loadAuditReportWithThreshold tests', () => {
},
};
- const get = vi.fn().mockResolvedValue({
+ const get = testing.fn().mockResolvedValue({
data: auditreport,
});
@@ -1706,11 +1706,11 @@ describe('loadDeltaAuditReport function tests', () => {
[identifier]: false,
},
});
- const getState = vi.fn().mockReturnValue(rootState);
+ const getState = testing.fn().mockReturnValue(rootState);
- const dispatch = vi.fn();
+ const dispatch = testing.fn();
- const getDelta = vi.fn().mockResolvedValue({
+ const getDelta = testing.fn().mockResolvedValue({
data: {foo: 'bar'},
});
@@ -1761,11 +1761,11 @@ describe('loadDeltaAuditReport function tests', () => {
[identifier]: false,
},
});
- const getState = vi.fn().mockReturnValue(rootState);
+ const getState = testing.fn().mockReturnValue(rootState);
- const dispatch = vi.fn();
+ const dispatch = testing.fn();
- const getDelta = vi.fn().mockResolvedValue({
+ const getDelta = testing.fn().mockResolvedValue({
data: {foo: 'bar'},
});
@@ -1816,11 +1816,11 @@ describe('loadDeltaAuditReport function tests', () => {
},
});
- const getState = vi.fn().mockReturnValue(rootState);
+ const getState = testing.fn().mockReturnValue(rootState);
- const dispatch = vi.fn();
+ const dispatch = testing.fn();
- const getDelta = vi.fn().mockResolvedValue([{id: 'foo'}]);
+ const getDelta = testing.fn().mockResolvedValue([{id: 'foo'}]);
const gmp = {
auditreport: {
@@ -1847,11 +1847,11 @@ describe('loadDeltaAuditReport function tests', () => {
},
});
- const getState = vi.fn().mockReturnValue(rootState);
+ const getState = testing.fn().mockReturnValue(rootState);
- const dispatch = vi.fn();
+ const dispatch = testing.fn();
- const getDelta = vi.fn().mockRejectedValue('An Error');
+ const getDelta = testing.fn().mockRejectedValue('An Error');
const gmp = {
auditreport: {