Skip to content

Commit

Permalink
Improve test typing
Browse files Browse the repository at this point in the history
  • Loading branch information
nateweller committed Nov 5, 2024
1 parent 6af22c1 commit 5c84d70
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 16 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { type Threat } from '@automattic/jetpack-scan';
import { render, screen } from '@testing-library/react';
import ThreatsDataViews from '..';

Expand All @@ -14,17 +13,20 @@ const data = [
fixedIn: null,
fixedOn: '2024-10-07T20:45:06.000Z',
fixable: { fixer: 'rollback', target: 'January 26, 2024, 6:49 am', extensionStatus: '' },
fixer: { status: 'in_progress', startedAt: '2024-10-07T20:45:06.000Z' },
fixer: {
status: 'in_progress' as const,
startedAt: '2024-10-07T20:45:06.000Z',
lastUpdated: '2024-10-07T20:45:06.000Z',
},
severity: 8,
status: 'current',
status: 'current' as const,
filename: '/var/www/html/wp-content/index.php',
context: {
'1': 'echo <<<HTML',
'2': 'X5O!P%@AP[4\\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*',
'3': 'HTML;',
marks: {},
},
source: null,
},
// Protect Report Data
{
Expand All @@ -37,20 +39,12 @@ const data = [
name: 'WooCommerce',
slug: 'woocommerce',
version: '3.2.3',
type: 'plugin',
type: 'plugin' as const,
},
fixedIn: '3.2.4',
context: null,
filename: null,
firstDetected: null,
fixable: null,
fixedOn: null,
fixer: null,
severity: null,
signature: null,
status: null,
status: 'current' as const,
},
] as Threat[];
];

describe( 'ThreatsDataViews', () => {
it( 'renders threat data', () => {
Expand Down
2 changes: 1 addition & 1 deletion projects/js-packages/scan/src/types/fixers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export type ThreatFixStatusError = {

export type ThreatFixStatusSuccess = {
status: FixerStatus;
last_updated: string;
lastUpdated: string;
};

export type ThreatFixStatus = ThreatFixStatusError | ThreatFixStatusSuccess;

0 comments on commit 5c84d70

Please sign in to comment.