From 69493c0ba5042d4376ef9e5a8749efab2914ee35 Mon Sep 17 00:00:00 2001 From: Aleksandr Borovskii Date: Thu, 20 Jul 2023 12:56:33 +0200 Subject: [PATCH] feat(scan): use XSS instead of deprecated DOM_XSS at tests Closes #169 --- packages/scan/src/DefaultScans.spec.ts | 4 ++-- packages/scan/src/ScanFactory.spec.ts | 8 ++++---- packages/scan/src/ScanSettings.spec.ts | 8 ++++---- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/packages/scan/src/DefaultScans.spec.ts b/packages/scan/src/DefaultScans.spec.ts index e24444ea..fc97ab06 100644 --- a/packages/scan/src/DefaultScans.spec.ts +++ b/packages/scan/src/DefaultScans.spec.ts @@ -110,7 +110,7 @@ describe('HttpScans', () => { await scans.createScan({ name: 'test', - tests: [TestType.STORED_XSS], + tests: [TestType.XSS], module: Module.DAST }); @@ -139,7 +139,7 @@ describe('HttpScans', () => { const result = scans.createScan({ name: 'test', - tests: [TestType.STORED_XSS], + tests: [TestType.XSS], module: Module.DAST }); diff --git a/packages/scan/src/ScanFactory.spec.ts b/packages/scan/src/ScanFactory.spec.ts index 600ad8ed..0019cd2a 100644 --- a/packages/scan/src/ScanFactory.spec.ts +++ b/packages/scan/src/ScanFactory.spec.ts @@ -53,7 +53,7 @@ describe('ScanFactory', () => { it('should create a scan', async () => { const settings: ScanSettingsOptions = { target: { url: 'https://example.com' }, - tests: [TestType.STORED_XSS] + tests: [TestType.XSS] }; when(mockedScans.uploadHar(anything())).thenResolve({ id: fileId }); when(mockedScans.createScan(anything())).thenResolve({ id: scanId }); @@ -68,7 +68,7 @@ describe('ScanFactory', () => { name: 'GET example.com', module: Module.DAST, discoveryTypes: [Discovery.ARCHIVE], - tests: [TestType.STORED_XSS] + tests: [TestType.XSS] }) ) ).once(); @@ -78,7 +78,7 @@ describe('ScanFactory', () => { it('should generate and upload a HAR file', async () => { const settings: ScanSettingsOptions = { target: { url: 'https://example.com' }, - tests: [TestType.STORED_XSS] + tests: [TestType.XSS] }; when(mockedScans.uploadHar(anything())).thenResolve({ id: fileId }); when(mockedScans.createScan(anything())).thenResolve({ id: scanId }); @@ -108,7 +108,7 @@ describe('ScanFactory', () => { 'hex' )}.example.com` }, - tests: [TestType.STORED_XSS] + tests: [TestType.XSS] }; when(mockedScans.uploadHar(anything())).thenResolve({ id: fileId }); when(mockedScans.createScan(anything())).thenResolve({ id: scanId }); diff --git a/packages/scan/src/ScanSettings.spec.ts b/packages/scan/src/ScanSettings.spec.ts index c846d90f..29a3c402 100644 --- a/packages/scan/src/ScanSettings.spec.ts +++ b/packages/scan/src/ScanSettings.spec.ts @@ -107,7 +107,7 @@ describe('ScanSettings', () => { // arrange const settings: ScanSettingsOptions = { name: 'my scan', - tests: [TestType.STORED_XSS], + tests: [TestType.XSS], target: { url: 'https://example.com' } }; @@ -123,7 +123,7 @@ describe('ScanSettings', () => { it('should create a settings with default name', () => { // arrange const settings: ScanSettingsOptions = { - tests: [TestType.STORED_XSS], + tests: [TestType.XSS], target: { url: 'https://example.com' } }; @@ -140,7 +140,7 @@ describe('ScanSettings', () => { // arrange const settings: ScanSettingsOptions = { name: randomBytes(201).toString('hex'), - tests: [TestType.STORED_XSS], + tests: [TestType.XSS], target: { url: 'https://example.com' } }; @@ -153,7 +153,7 @@ describe('ScanSettings', () => { it('should truncate a default name if hostname is greater than 200 characters', () => { // arrange const settings: ScanSettingsOptions = { - tests: [TestType.STORED_XSS], + tests: [TestType.XSS], target: { url: `https://subdomain-${randomBytes(200).toString( 'hex'