(t *testing.T)
| 138 | } |
| 139 | |
| 140 | func TestTranslateMessage(t *testing.T) { |
| 141 | cmd := test.GetRootCmdWithSubCommands(NewCmds()...) |
| 142 | ch := test.InitChannel(t) |
| 143 | u := test.CreateUser() |
| 144 | m := test.CreateMessageWithText(ch, u, "hi") |
| 145 | t.Cleanup(func() { |
| 146 | test.DeleteMessage(m) |
| 147 | test.DeleteUser(u) |
| 148 | test.DeleteChannel(ch) |
| 149 | }) |
| 150 | |
| 151 | cmd.SetArgs([]string{"translate-message", "-m", m, "-l", "hu"}) |
| 152 | _, err := cmd.ExecuteC() |
| 153 | require.NoError(t, err) |
| 154 | require.Contains(t, cmd.OutOrStdout().(*bytes.Buffer).String(), "szia") |
| 155 | } |
nothing calls this directly
no test coverage detected