]> git.giacomolli.uk - onechat/blobdiff - command_test.go
Select notification targets by stable ID
[onechat] / command_test.go
index 3d89327078432ad9bd5f3075226ddb83eb51de7e..a28a2a2fcecf9b1402bc853e8f28339e5fe43468 100644 (file)
@@ -22,6 +22,21 @@ func TestHelpListsVersionCommand(t *testing.T) {
        require.Contains(t, commandOutput(t, "help"), "  version                  show the build version\n")
 }
 
+func TestHelpListsTheImportTargetFlag(t *testing.T) {
+       help := commandOutput(t, "help")
+       require.Contains(t, help, "import [-n] [--agent NAME] ZIP...")
+       require.Contains(t, help, "--agent NAME           import into an existing direct child (default: root)")
+}
+
+func TestHelpListsTheStableNotificationTargetFlag(t *testing.T) {
+       require.Contains(t, commandOutput(t, "help"), "notify [--agent-id ID] --source SOURCE --id ID --text TEXT")
+
+       help := commandOutput(t, "notify", "--help")
+       require.Contains(t, help, "not processed")
+       require.Contains(t, help, "--agent-id ID")
+       require.NotContains(t, help, "--agent NAME")
+}
+
 func commandOutput(t *testing.T, args ...string) string {
        t.Helper()