libraryelements: Spanner compability (#103881)

* libraryelements: fix compatibility with Spanner

* Log errors leading to status code 500.

* Rename tests to make them integration tests.
This commit is contained in:
Peter Štibraný
2025-04-24 16:10:03 +02:00
committed by GitHub
parent e7b800f35a
commit 08205d64d1
8 changed files with 36 additions and 25 deletions

View File

@ -62,7 +62,7 @@ func TestMain(m *testing.M) {
testsuite.Run(m)
}
func TestDeleteLibraryPanelsInFolder(t *testing.T) {
func TestIntegration_DeleteLibraryPanelsInFolder(t *testing.T) {
scenarioWithPanel(t, "When an admin tries to delete a folder that contains connected library elements, it should fail",
func(t *testing.T, sc scenarioContext) {
dashJSON := map[string]any{
@ -137,7 +137,7 @@ func TestDeleteLibraryPanelsInFolder(t *testing.T) {
})
}
func TestGetLibraryPanelConnections(t *testing.T) {
func TestIntegration_GetLibraryPanelConnections(t *testing.T) {
scenarioWithPanel(t, "When an admin tries to get connections of library panel, it should succeed and return correct result",
func(t *testing.T, sc scenarioContext) {
dashJSON := map[string]any{
@ -549,6 +549,7 @@ func testScenario(t *testing.T, desc string, fn func(t *testing.T, sc scenarioCo
SQLStore: sqlStore,
folderService: folderSvc,
dashboardsService: dashService,
log: log.NewNopLogger(),
}
// deliberate difference between signed in user and user in db to make it crystal clear