()
| 287 | } |
| 288 | |
| 289 | func (s *PluginSuite) Test_GetDisplay() { |
| 290 | conf, err := s.db.GetPluginConfByUserAndPath(1, mock.ModulePath) |
| 291 | assert.NoError(s.T(), err) |
| 292 | inst, err := s.manager.Instance(conf.ID) |
| 293 | assert.Nil(s.T(), err) |
| 294 | mockInst := inst.(*mock.PluginInstance) |
| 295 | |
| 296 | mockInst.DisplayString = "test string" |
| 297 | |
| 298 | { |
| 299 | test.WithUser(s.ctx, 1) |
| 300 | |
| 301 | s.ctx.Request = httptest.NewRequest("GET", fmt.Sprintf("/plugin/%d/display", conf.ID), nil) |
| 302 | s.ctx.Params = gin.Params{{Key: "id", Value: fmt.Sprint(conf.ID)}} |
| 303 | s.a.GetDisplay(s.ctx) |
| 304 | |
| 305 | assert.Equal(s.T(), 200, s.recorder.Code) |
| 306 | test.JSONEquals(s.T(), mockInst.DisplayString, s.recorder.Body.String()) |
| 307 | } |
| 308 | } |
| 309 | |
| 310 | func (s *PluginSuite) Test_GetDisplay_NotImplemented_expectEmptyString() { |
| 311 | conf, err := s.db.GetPluginConfByUserAndPath(1, mock.ModulePath) |
nothing calls this directly
no test coverage detected