Skip to content

Commit

Permalink
feat(scan): use XSS instead of deprecated DOM_XSS at tests
Browse files Browse the repository at this point in the history
Closes #169
  • Loading branch information
aborovsky committed Jul 20, 2023
1 parent 2fc8c0e commit 69493c0
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions packages/scan/src/DefaultScans.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ describe('HttpScans', () => {

await scans.createScan({
name: 'test',
tests: [TestType.STORED_XSS],
tests: [TestType.XSS],
module: Module.DAST
});

Expand Down Expand Up @@ -139,7 +139,7 @@ describe('HttpScans', () => {

const result = scans.createScan({
name: 'test',
tests: [TestType.STORED_XSS],
tests: [TestType.XSS],
module: Module.DAST
});

Expand Down
8 changes: 4 additions & 4 deletions packages/scan/src/ScanFactory.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 });
Expand All @@ -68,7 +68,7 @@ describe('ScanFactory', () => {
name: 'GET example.com',
module: Module.DAST,
discoveryTypes: [Discovery.ARCHIVE],
tests: [TestType.STORED_XSS]
tests: [TestType.XSS]
})
)
).once();
Expand All @@ -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 });
Expand Down Expand Up @@ -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 });
Expand Down
8 changes: 4 additions & 4 deletions packages/scan/src/ScanSettings.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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' }
};

Expand All @@ -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' }
};

Expand All @@ -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' }
};

Expand All @@ -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'
Expand Down

0 comments on commit 69493c0

Please sign in to comment.