(t *testing.T)
| 121 | } |
| 122 | |
| 123 | func TestFlagMessage(t *testing.T) { |
| 124 | cmd := test.GetRootCmdWithSubCommands(NewCmds()...) |
| 125 | ch := test.InitChannel(t) |
| 126 | u := test.CreateUser() |
| 127 | m := test.CreateMessage(ch, u) |
| 128 | t.Cleanup(func() { |
| 129 | test.DeleteMessage(m) |
| 130 | test.DeleteUser(u) |
| 131 | test.DeleteChannel(ch) |
| 132 | }) |
| 133 | |
| 134 | cmd.SetArgs([]string{"flag-message", "-m", m, "-u", u}) |
| 135 | _, err := cmd.ExecuteC() |
| 136 | require.NoError(t, err) |
| 137 | require.Contains(t, cmd.OutOrStdout().(*bytes.Buffer).String(), "Successfully flagged message") |
| 138 | } |
| 139 | |
| 140 | func TestTranslateMessage(t *testing.T) { |
| 141 | cmd := test.GetRootCmdWithSubCommands(NewCmds()...) |
nothing calls this directly
no test coverage detected