fleet/frontend/__mocks__/scheduleableQueryMock.ts
Jacob Shandling df2ada1809
UI - Add 'Discard data' option to Save Query modal (#14284)
## Addresses pt.1 of #13470

4 states + InfoBanner:

<img width="746" alt="Screenshot 2023-10-03 at 2 51 36 PM"
src="https://github.com/fleetdm/fleet/assets/61553566/0cffd9a1-8a96-4723-a080-10d68d7c7c70">
<img width="746" alt="Screenshot 2023-10-03 at 2 51 55 PM"
src="https://github.com/fleetdm/fleet/assets/61553566/12237208-f29a-4c90-86c8-8fb71d64fbf4">
<img width="746" alt="Screenshot 2023-10-03 at 2 52 20 PM"
src="https://github.com/fleetdm/fleet/assets/61553566/6bdeb8c6-250f-4edb-a630-aa978a98e428">
<img width="746" alt="Screenshot 2023-10-03 at 2 52 26 PM"
src="https://github.com/fleetdm/fleet/assets/61553566/bae0e656-56f4-4f6a-9972-5ff0fa2f24bf">

<img width="735" alt="Screenshot 2023-10-03 at 5 15 44 PM"
src="https://github.com/fleetdm/fleet/assets/61553566/b26ce3ed-7949-4823-a6a4-fa04e152a480">

## Checklist for submitter
- [x] Manual QA for all new/changed functionality

---------

Co-authored-by: Jacob Shandling <jacob@fleetdm.com>
2023-10-04 15:19:26 -07:00

41 lines
1.0 KiB
TypeScript

// "SchedulableQuery" to be used in developing frontend for #7765
import { ISchedulableQuery } from "interfaces/schedulable_query";
const DEFAULT_SCHEDULABLE_QUERY_MOCK: ISchedulableQuery = {
created_at: "2022-11-03T17:22:14Z",
updated_at: "2022-11-03T17:22:14Z",
id: 1,
name: "Test Query",
description: "A test query",
query: "SELECT * FROM users",
team_id: null,
interval: 43200, // Every 12 hours
platform: "darwin,windows,linux",
min_osquery_version: "",
automations_enabled: true,
logging: "snapshot",
saved: true,
author_id: 1,
author_name: "Test User",
author_email: "test@example.com",
observer_can_run: false,
discard_data: false,
packs: [],
stats: {
system_time_p50: 28.1053,
system_time_p95: 397.6667,
user_time_p50: 29.9412,
user_time_p95: 251.4615,
total_executions: 5746,
},
};
const createMockSchedulableQuery = (
overrides?: Partial<ISchedulableQuery>
): ISchedulableQuery => {
return { ...DEFAULT_SCHEDULABLE_QUERY_MOCK, ...overrides };
};
export default createMockSchedulableQuery;