mirror of
https://github.com/grafana/grafana.git
synced 2025-01-18 20:43:26 -06:00
50c2b4682a
* Chore: Rename integration tests * Remove one Integration Co-authored-by: Ida Furjesova <ida.furjesova@grafana.com>
27 lines
702 B
Go
27 lines
702 B
Go
//go:build integration
|
|
// +build integration
|
|
|
|
package queryhistory
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/grafana/grafana/pkg/components/simplejson"
|
|
"github.com/stretchr/testify/require"
|
|
)
|
|
|
|
func TestIntegrationCreateQueryInQueryHistory(t *testing.T) {
|
|
testScenario(t, "When users tries to create query in query history it should succeed",
|
|
func(t *testing.T, sc scenarioContext) {
|
|
command := CreateQueryInQueryHistoryCommand{
|
|
DatasourceUID: "NCzh67i",
|
|
Queries: simplejson.NewFromAny(map[string]interface{}{
|
|
"expr": "test",
|
|
}),
|
|
}
|
|
sc.reqContext.Req.Body = mockRequestBody(command)
|
|
resp := sc.service.createHandler(sc.reqContext)
|
|
require.Equal(t, 200, resp.Status())
|
|
})
|
|
}
|