diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index 0874922..b0d66d6 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -4,7 +4,10 @@
-
+
+
+
+
@@ -53,7 +56,7 @@
"git-widget-placeholder": "main",
"go.import.settings.migrated": "true",
"javascript.preferred.runtime.type.id": "node",
- "last_opened_file_path": "//wsl.localhost/Ubuntu/home/ahilbig/git/vcr/zabbix-graphql-api/.forgejo/workflows",
+ "last_opened_file_path": "//wsl.localhost/Ubuntu/home/ahilbig/git/vcr/zabbix-graphql-api/src/test",
"node.js.detected.package.eslint": "true",
"node.js.detected.package.tslint": "true",
"node.js.selected.package.eslint": "(autodetect)",
@@ -76,6 +79,7 @@
+
@@ -117,7 +121,7 @@
1768273021451
-
+
@@ -159,7 +163,15 @@
1768312137448
-
+
+
+ 1768312304586
+
+
+
+ 1768312304586
+
+
@@ -183,6 +195,7 @@
-
+
+
\ No newline at end of file
diff --git a/src/test/zabbix_api_args_parser.test.ts b/src/test/zabbix_api_args_parser.test.ts
new file mode 100644
index 0000000..ed379d9
--- /dev/null
+++ b/src/test/zabbix_api_args_parser.test.ts
@@ -0,0 +1,28 @@
+import {ParsedArgs, ZabbixWithTagsParams} from "../datasources/zabbix-request.js";
+
+test("Parse Zabbix Args", () => {
+ let name_pattern = "Test"
+ let input = {
+ name_pattern: name_pattern,
+ tag_deviceType: ["x1", "x2"]
+ }
+ let args = new ParsedArgs(input)
+ expect(args, "name_pattern should be extracted").not.toContain(name_pattern)
+ // @ts-ignore
+ expect("Testwert", "name_pattern should be converted to regex").toMatch(args.name_pattern)
+ expect((args.zabbix_params).tags).toContainEqual({
+ "tag": "deviceType",
+ "operator": 1,
+ "value": "x1"
+ })
+ expect((args.zabbix_params).tags).toContainEqual({
+ "tag": "deviceType",
+ "operator": 1,
+ "value": "x2"
+ })
+ expect((new ParsedArgs({tag_x: "x1"}).zabbix_params).tags).toContainEqual({
+ "tag": "x",
+ "operator": 1,
+ "value": "x1"
+ })
+});