@@ -12,8 +12,9 @@ import (
1212func TestChatsCreate (t * testing.T ) {
1313 t .Run ("regular flags" , func (t * testing.T ) {
1414 mocktest .TestRunMockTestWithFlags (
15- t , "chats" , "create" ,
15+ t ,
1616 "--access-token" , "string" ,
17+ "chats" , "create" ,
1718 "--account-id" , "accountID" ,
1819 "--allow-invite=true" ,
1920 "--message-text" , "messageText" ,
@@ -31,8 +32,9 @@ func TestChatsCreate(t *testing.T) {
3132
3233 // Alternative argument passing style using inner flags
3334 mocktest .TestRunMockTestWithFlags (
34- t , "chats" , "create" ,
35+ t ,
3536 "--access-token" , "string" ,
37+ "chats" , "create" ,
3638 "--account-id" , "accountID" ,
3739 "--allow-invite=true" ,
3840 "--message-text" , "messageText" ,
@@ -66,17 +68,19 @@ func TestChatsCreate(t *testing.T) {
6668 " phoneNumber: phoneNumber\n " +
6769 " username: username\n " )
6870 mocktest .TestRunMockTestWithPipeAndFlags (
69- t , pipeData , "chats" , "create" ,
71+ t , pipeData ,
7072 "--access-token" , "string" ,
73+ "chats" , "create" ,
7174 )
7275 })
7376}
7477
7578func TestChatsRetrieve (t * testing.T ) {
7679 t .Run ("regular flags" , func (t * testing.T ) {
7780 mocktest .TestRunMockTestWithFlags (
78- t , "chats" , "retrieve" ,
81+ t ,
7982 "--access-token" , "string" ,
83+ "chats" , "retrieve" ,
8084 "--chat-id" , "!NCdzlIaMjZUmvmvyHU:beeper.com" ,
8185 "--max-participant-count" , "50" ,
8286 )
@@ -86,8 +90,9 @@ func TestChatsRetrieve(t *testing.T) {
8690func TestChatsList (t * testing.T ) {
8791 t .Run ("regular flags" , func (t * testing.T ) {
8892 mocktest .TestRunMockTestWithFlags (
89- t , "chats" , "list" ,
93+ t ,
9094 "--access-token" , "string" ,
95+ "chats" , "list" ,
9196 "--max-items" , "10" ,
9297 "--account-id" , "local-whatsapp_ba_EvYDBBsZbRQAy3UOSWqG0LuTVkc" ,
9398 "--account-id" , "local-instagram_ba_eRfQMmnSNy_p7Ih7HL7RduRpKFU" ,
@@ -100,8 +105,9 @@ func TestChatsList(t *testing.T) {
100105func TestChatsArchive (t * testing.T ) {
101106 t .Run ("regular flags" , func (t * testing.T ) {
102107 mocktest .TestRunMockTestWithFlags (
103- t , "chats" , "archive" ,
108+ t ,
104109 "--access-token" , "string" ,
110+ "chats" , "archive" ,
105111 "--chat-id" , "!NCdzlIaMjZUmvmvyHU:beeper.com" ,
106112 "--archived=true" ,
107113 )
@@ -111,8 +117,9 @@ func TestChatsArchive(t *testing.T) {
111117 // Test piping YAML data over stdin
112118 pipeData := []byte ("archived: true" )
113119 mocktest .TestRunMockTestWithPipeAndFlags (
114- t , pipeData , "chats" , "archive" ,
120+ t , pipeData ,
115121 "--access-token" , "string" ,
122+ "chats" , "archive" ,
116123 "--chat-id" , "!NCdzlIaMjZUmvmvyHU:beeper.com" ,
117124 )
118125 })
@@ -121,8 +128,9 @@ func TestChatsArchive(t *testing.T) {
121128func TestChatsSearch (t * testing.T ) {
122129 t .Run ("regular flags" , func (t * testing.T ) {
123130 mocktest .TestRunMockTestWithFlags (
124- t , "chats" , "search" ,
131+ t ,
125132 "--access-token" , "string" ,
133+ "chats" , "search" ,
126134 "--max-items" , "10" ,
127135 "--account-id" , "local-whatsapp_ba_EvYDBBsZbRQAy3UOSWqG0LuTVkc" ,
128136 "--account-id" , "local-telegram_ba_QFrb5lrLPhO3OT5MFBeTWv0x4BI" ,
0 commit comments