fleet/frontend/__mocks__/policyMock.ts
Jacob Shandling cb58849d95
Fleet Premium to Sandbox (#11372)
## Addresses #9371 
### Adds a suite of UI logic for premium features in the Sandbox
environment

For reviewer: please review the work for the below 3 substasks, which
are the only remaining subtasks encompassed by this PR that have not yet
passed review individually:
  - #10822 (9)
  - #10823 (10)
  - #10824 (11)

## Checklist for submitter
- [x] Changes file added for user-visible changes in `changes/`
- [x] Manual QA for all new/changed functionality

---------

Co-authored-by: Jacob Shandling <jacob@fleetdm.com>
Co-authored-by: Martin Angers <martin.n.angers@gmail.com>
2023-04-27 08:53:30 -07:00

31 lines
1001 B
TypeScript

import { IPolicyStats } from "interfaces/policy";
const DEFAULT_POLICY_MOCK: IPolicyStats = {
id: 1,
name: "Antivirus healthy (Linux)",
query:
"SELECT score FROM (SELECT case when COUNT(*) = 2 then 1 ELSE 0 END AS score FROM processes WHERE (name = 'clamd') OR (name = 'freshclam')) WHERE score == 1;",
critical: false,
description:
"Checks that both ClamAV's daemon and its updater service (freshclam) are running.",
author_id: 1,
author_name: "Test User",
author_email: "test@user.com",
team_id: undefined,
resolution: "Ensure ClamAV and Freshclam are installed and running.",
platform: "linux" as const,
created_at: "2023-03-24T22:13:59Z",
updated_at: "2023-03-31T19:05:13Z",
passing_host_count: 0,
failing_host_count: 8,
webhook: "Off",
has_run: true,
osquery_policy_ms: 3600000,
};
const createMockPolicy = (overrides?: Partial<IPolicyStats>): IPolicyStats => {
return { ...DEFAULT_POLICY_MOCK, ...overrides };
};
export default createMockPolicy;