Dashboard tags: add dashboard_uid and org_id (#98500)
This commit is contained in:
@@ -213,15 +213,31 @@ func TestIntegrationDashboardDataAccess(t *testing.T) {
|
||||
assert.Equal(t, len(queryResult), 2)
|
||||
})
|
||||
|
||||
t.Run("Should be able to delete dashboard", func(t *testing.T) {
|
||||
t.Run("Should be able to delete dashboard and associated tags", func(t *testing.T) {
|
||||
setup()
|
||||
dash := insertTestDashboard(t, dashboardStore, "delete me", 1, 0, "", false, "delete this")
|
||||
|
||||
err := dashboardStore.DeleteDashboard(context.Background(), &dashboards.DeleteDashboardCommand{
|
||||
tags, err := dashboardStore.GetDashboardTags(context.Background(), &dashboards.GetDashboardTagsQuery{OrgID: 1})
|
||||
require.NoError(t, err)
|
||||
terms := make([]string, len(tags))
|
||||
for i, tag := range tags {
|
||||
terms[i] = tag.Term
|
||||
}
|
||||
require.Contains(t, terms, "delete this")
|
||||
|
||||
err = dashboardStore.DeleteDashboard(context.Background(), &dashboards.DeleteDashboardCommand{
|
||||
ID: dash.ID,
|
||||
OrgID: 1,
|
||||
})
|
||||
require.NoError(t, err)
|
||||
|
||||
tags, err = dashboardStore.GetDashboardTags(context.Background(), &dashboards.GetDashboardTagsQuery{OrgID: 1})
|
||||
require.NoError(t, err)
|
||||
terms = make([]string, len(tags))
|
||||
for i, tag := range tags {
|
||||
terms[i] = tag.Term
|
||||
}
|
||||
require.NotContains(t, terms, "delete this")
|
||||
})
|
||||
|
||||
t.Run("Should be able to create dashboard", func(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user