(t *testing.T)
| 67 | } |
| 68 | |
| 69 | func TestGetMultipleMessage(t *testing.T) { |
| 70 | cmd := test.GetRootCmdWithSubCommands(NewCmds()...) |
| 71 | ch := test.InitChannel(t) |
| 72 | u := test.CreateUser() |
| 73 | m1 := test.CreateMessage(ch, u) |
| 74 | m2 := test.CreateMessage(ch, u) |
| 75 | t.Cleanup(func() { |
| 76 | test.DeleteMessage(m1) |
| 77 | test.DeleteMessage(m2) |
| 78 | test.DeleteUser(u) |
| 79 | test.DeleteChannel(ch) |
| 80 | }) |
| 81 | |
| 82 | cmd.SetArgs([]string{"get-messages", "-t", "messaging", "-i", ch, m1, m2}) |
| 83 | _, err := cmd.ExecuteC() |
| 84 | require.NoError(t, err) |
| 85 | require.Contains(t, cmd.OutOrStdout().(*bytes.Buffer).String(), m1) |
| 86 | require.Contains(t, cmd.OutOrStdout().(*bytes.Buffer).String(), m2) |
| 87 | } |
| 88 | |
| 89 | func TestDeleteMessage(t *testing.T) { |
| 90 | cmd := test.GetRootCmdWithSubCommands(NewCmds()...) |
nothing calls this directly
no test coverage detected