INNER CODE UNIT · Go
TestAccSentryDashboardDataSource_basic
jianyuan/terraform-provider-sentry · sentry/data_source_sentry_dashboard_test.go:11
func TestAccSentryDashboardDataSource_basic(t *testing.T) {
dashboardTitle := acctest.RandomWithPrefix("tf-dashboard")
rn := "sentry_dashboard.test"
dn := "data.sentry_dashboard.test"
rnCopy := "sentry_dashboard.test_copy"
check := func(name, dashboardTitle string) resource.TestCheckFunc {
var dashboardID string
return resource.ComposeTestCheckFunc(
testAccCheckSentryDashboardExists(name, &dashboardID),
resource.TestCheckResourceAttr(name, "organization", acctest.TestOrganization),
resource.TestCheckResourceAttr(name, "title", dashboardTitle),
resource.TestCheckResourceAttr(name, "widget.#", "1"),
resource.TestCheckTypeSetElemNestedAttrs(name, "widget.*", map[string]string{
"title": "Custom Widget",
"display_type": "table",
}),