mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
* Chore: Run integration tests without grabpl * Add new step for integration tests in lib.star * Remove old integration test step from lib.star * Change drone signature * Fix: Edit starlark integration step to not affect enterprise * Remove all build tags & rename starlark integration test step * Resync .drone.yml with .drone.star * Fix lint errors * Fix lint errors * Fix lint errors * Fix more lint errors * Fix another lint error * Rename integration test step * Fix last lint error * Recomment enterprise step * Remove comment from Makefile Co-authored-by: Ida Furjesova <ida.furjesova@grafana.com>
26 lines
979 B
Go
26 lines
979 B
Go
package queryhistory
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/grafana/grafana/pkg/web"
|
|
"github.com/stretchr/testify/require"
|
|
)
|
|
|
|
func TestIntegrationPatchQueryCommentInQueryHistory(t *testing.T) {
|
|
testScenarioWithQueryInQueryHistory(t, "When user tries to patch comment of query in query history that does not exist, it should fail",
|
|
func(t *testing.T, sc scenarioContext) {
|
|
resp := sc.service.patchCommentHandler(sc.reqContext)
|
|
require.Equal(t, 500, resp.Status())
|
|
})
|
|
|
|
testScenarioWithQueryInQueryHistory(t, "When user tries to patch comment of query in query history that exists, it should succeed",
|
|
func(t *testing.T, sc scenarioContext) {
|
|
cmd := PatchQueryCommentInQueryHistoryCommand{Comment: "test comment"}
|
|
sc.ctx.Req = web.SetURLParams(sc.ctx.Req, map[string]string{":uid": sc.initialResult.Result.UID})
|
|
sc.reqContext.Req.Body = mockRequestBody(cmd)
|
|
resp := sc.service.patchCommentHandler(sc.reqContext)
|
|
require.Equal(t, 200, resp.Status())
|
|
})
|
|
}
|