Farmbot-Web-App/frontend/__test_support__/fake_farmwares.ts

63 lines
1.5 KiB
TypeScript
Raw Normal View History

2019-03-20 14:18:19 -06:00
import { Farmwares, FarmwareManifestInfo } from "../farmware/interfaces";
import {
LegacyFarmwareManifest as FarmwareManifestV1,
FarmwareManifest as FarmwareManifestV2,
} from "farmbot";
2017-10-27 02:06:20 -06:00
2019-03-20 14:18:19 -06:00
export function fakeFarmware(): FarmwareManifestInfo {
2017-10-27 02:06:20 -06:00
return {
2018-06-21 15:04:21 -06:00
name: "My Fake Farmware",
2019-03-20 14:18:19 -06:00
installation_pending: false,
2018-06-21 15:04:21 -06:00
url: "https://",
config: [{ name: "config_1", label: "Config 1", value: "4" }],
meta: {
2019-03-20 14:18:19 -06:00
fbos_version: ">=3.0.0",
farmware_tools_version: ">=1.0.0",
2018-06-21 15:04:21 -06:00
description: "Does things.",
language: "forth",
version: "0.0.0",
author: "me",
2017-10-27 02:06:20 -06:00
}
};
}
2018-06-21 15:04:21 -06:00
export function fakeFarmwares(): Farmwares {
return {
"farmware_0": fakeFarmware()
};
}
2019-03-20 14:18:19 -06:00
export const fakeFarmwareManifestV1 = (): FarmwareManifestV1 => ({
name: "My Fake Farmware",
uuid: "farmware_0",
executable: "forth",
args: ["my_farmware.fth"],
url: "https://",
path: "my_farmware",
config: [{ name: "config_1", label: "Config 1", value: "4" }],
meta: {
min_os_version_major: "3",
description: "Does things.",
language: "forth",
version: "0.0.0",
author: "me",
zip: "https://"
}
});
export const fakeFarmwareManifestV2 = (): FarmwareManifestV2 => ({
farmware_manifest_version: "2.0",
package: "My Fake Farmware",
package_version: "0.0.0",
description: "Also does things.",
author: "you",
language: "forth",
executable: "forth",
args: "my_farmware.fth",
config: {},
farmbot_os_version_requirement: ">=3.0.0",
farmware_tools_version_requirement: ">=0.0.0",
url: "https://",
zip: "https://",
});