From 66b511648360db65da766e46384c7f1c83ed693f Mon Sep 17 00:00:00 2001 From: Qubasa Date: Wed, 18 Jun 2025 12:55:47 +0200 Subject: [PATCH] clan-app: Fix storybook tests --- .../ui/src/components/RemoteForm.stories.tsx | 6 + .../__snapshots__/RemoteForm.stories.tsx.snap | 970 ++++++++++++++++++ .../__snapshots__/Button.stories.tsx.snap | 2 +- 3 files changed, 977 insertions(+), 1 deletion(-) create mode 100644 pkgs/clan-app/ui/src/components/__snapshots__/RemoteForm.stories.tsx.snap diff --git a/pkgs/clan-app/ui/src/components/RemoteForm.stories.tsx b/pkgs/clan-app/ui/src/components/RemoteForm.stories.tsx index f44d437fb..e88cc5955 100644 --- a/pkgs/clan-app/ui/src/components/RemoteForm.stories.tsx +++ b/pkgs/clan-app/ui/src/components/RemoteForm.stories.tsx @@ -186,6 +186,9 @@ export const Empty: Story = { "Empty form with default values. All fields start empty except for boolean defaults.", }, }, + test: { + timeout: 30000, + }, }, }; @@ -206,6 +209,9 @@ export const Populated: Story = { "Form pre-populated with sample data showing all field types in use.", }, }, + test: { + timeout: 30000, + }, }, }; diff --git a/pkgs/clan-app/ui/src/components/__snapshots__/RemoteForm.stories.tsx.snap b/pkgs/clan-app/ui/src/components/__snapshots__/RemoteForm.stories.tsx.snap new file mode 100644 index 000000000..1ebcc195b --- /dev/null +++ b/pkgs/clan-app/ui/src/components/__snapshots__/RemoteForm.stories.tsx.snap @@ -0,0 +1,970 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`Components/RemoteForm Disabled smoke-test 1`] = ` +
+

+ Remote Configuration +

+
+
+
+ +
+
+
+ +
+
+
+
+
+ +
+
+
+ +
+
+
+
+
+ +
+
+
+ +
+
+
+ + Current Form Data (Debug) + +
+      {
+  "address": "example.com",
+  "user": "admin",
+  "command_prefix": "sudo",
+  "port": 22,
+  "password": "",
+  "forward_agent": true,
+  "host_key_check": 1,
+  "verbose_ssh": false,
+  "ssh_options": {
+    "StrictHostKeyChecking": "no",
+    "UserKnownHostsFile": "/dev/null"
+  },
+  "tor_socks": false
+}
+    
+
+
+`; + +exports[`Components/RemoteForm Empty smoke-test 1`] = ` +
+

+ Remote Configuration +

+
+
+
+ +
+
+
+ +
+
+
+
+
+ +
+
+
+ +
+
+
+
+
+ +
+
+
+ +
+
+
+ + Current Form Data (Debug) + +
+      {
+  "address": "",
+  "user": "",
+  "command_prefix": "",
+  "password": "",
+  "forward_agent": false,
+  "host_key_check": 0,
+  "verbose_ssh": false,
+  "ssh_options": {},
+  "tor_socks": false
+}
+    
+
+
+`; + +exports[`Components/RemoteForm HiddenSaveButton smoke-test 1`] = ` +
+

+ Remote Configuration +

+
+
+
+ +
+
+
+ +
+
+
+
+
+ +
+
+
+ +
+
+
+
+
+ +
+
+
+
+ + Current Form Data (Debug) + +
+      {
+  "address": "example.com",
+  "user": "admin",
+  "command_prefix": "sudo",
+  "port": 22,
+  "password": "",
+  "forward_agent": true,
+  "host_key_check": 1,
+  "verbose_ssh": false,
+  "ssh_options": {
+    "StrictHostKeyChecking": "no",
+    "UserKnownHostsFile": "/dev/null"
+  },
+  "tor_socks": false
+}
+    
+
+
+`; + +exports[`Components/RemoteForm NixManaged smoke-test 1`] = ` +
+

+ Remote Configuration +

+
+
+
+ + + + + + Configuration managed by Nix + +
+ +
+
+
+ +
+
+
+ +
+
+
+
+
+ +
+
+
+ +
+
+
+
+
+ +
+
+
+ +
+
+
+ + Current Form Data (Debug) + +
+      {
+  "address": "192.168.1.100",
+  "user": "deploy",
+  "command_prefix": "doas",
+  "port": 2222,
+  "password": "",
+  "forward_agent": false,
+  "host_key_check": 2,
+  "verbose_ssh": true,
+  "ssh_options": {
+    "ConnectTimeout": "10",
+    "ServerAliveInterval": "60",
+    "ServerAliveCountMax": "3",
+    "Compression": "yes",
+    "TCPKeepAlive": "yes"
+  },
+  "tor_socks": true
+}
+    
+
+
+`; + +exports[`Components/RemoteForm Populated smoke-test 1`] = ` +
+

+ Remote Configuration +

+
+
+
+ +
+
+
+ +
+
+
+
+
+ +
+
+
+ +
+
+
+
+
+ +
+
+
+ +
+
+
+ + Current Form Data (Debug) + +
+      {
+  "address": "example.com",
+  "user": "admin",
+  "command_prefix": "sudo",
+  "port": 22,
+  "password": "",
+  "forward_agent": true,
+  "host_key_check": 1,
+  "verbose_ssh": false,
+  "ssh_options": {
+    "StrictHostKeyChecking": "no",
+    "UserKnownHostsFile": "/dev/null"
+  },
+  "tor_socks": false
+}
+    
+
+
+`; diff --git a/pkgs/clan-app/ui/src/components/v2/Button/__snapshots__/Button.stories.tsx.snap b/pkgs/clan-app/ui/src/components/v2/Button/__snapshots__/Button.stories.tsx.snap index c80fbcb65..9d66add10 100644 --- a/pkgs/clan-app/ui/src/components/v2/Button/__snapshots__/Button.stories.tsx.snap +++ b/pkgs/clan-app/ui/src/components/v2/Button/__snapshots__/Button.stories.tsx.snap @@ -1,7 +1,7 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`Components/Button GhostPrimary play-test 1`] = ` -
+