diff --git a/pkg/dashboards/dashboards_api_integration_test.go b/pkg/dashboards/dashboards_api_integration_test.go index 6edeb617..52277e6e 100644 --- a/pkg/dashboards/dashboards_api_integration_test.go +++ b/pkg/dashboards/dashboards_api_integration_test.go @@ -276,6 +276,8 @@ func TestIntegrationDashboard_Variables(t *testing.T) { // Test vars dashboardName := "newrelic-client-go test-dashboard-" + mock.RandSeq(5) + ignoreTimeRangeValue := true + excludedValue := true dashboardInput := DashboardInput{ Description: "Test description", Name: dashboardName, @@ -314,8 +316,8 @@ func TestIntegrationDashboard_Variables(t *testing.T) { }, Name: "variable", Options: &DashboardVariableOptionsInput{ - IgnoreTimeRange: true, - Excluded: true, + IgnoreTimeRange: &ignoreTimeRangeValue, + Excluded: &excludedValue, }, NRQLQuery: &DashboardVariableNRQLQueryInput{ AccountIDs: []int{testAccountID}, @@ -348,11 +350,11 @@ func TestIntegrationDashboard_Variables(t *testing.T) { assert.Equal(t, dashboardInput.Name, dash.Name) assert.Equal(t, entities.DashboardEntityPermissions(string(dashboardInput.Permissions)), dash.Permissions) - if dash.Variables[0].Options.IgnoreTimeRange != dashboardInput.Variables[0].Options.IgnoreTimeRange { - t.Errorf("Expected value to be %v but got %v\n", dashboardInput.Variables[0].Options.IgnoreTimeRange, dash.Variables[0].Options.IgnoreTimeRange) + if dash.Variables[0].Options.IgnoreTimeRange != *dashboardInput.Variables[0].Options.IgnoreTimeRange { + t.Errorf("Expected value to be %v but got %v\n", *dashboardInput.Variables[0].Options.IgnoreTimeRange, dash.Variables[0].Options.IgnoreTimeRange) } - if dash.Variables[0].Options.Excluded != dashboardInput.Variables[0].Options.Excluded { - t.Errorf("Expected value to be %v but got %v\n", dashboardInput.Variables[0].Options.Excluded, dash.Variables[0].Options.Excluded) + if dash.Variables[0].Options.Excluded != *dashboardInput.Variables[0].Options.Excluded { + t.Errorf("Expected value to be %v but got %v\n", *dashboardInput.Variables[0].Options.Excluded, dash.Variables[0].Options.Excluded) } // Input and Pages are different types so we can not easily compare them... assert.Equal(t, len(dashboardInput.Pages), len(dash.Pages)) @@ -365,6 +367,8 @@ func TestIntegrationDashboard_Variables(t *testing.T) { assert.Greater(t, len(dash.Pages[0].Widgets[0].RawConfiguration), 1) // Test: DashboardUpdate + ignoreTimeRangeValue = false + excludedValue = false updatedDashboard := DashboardInput{ Name: dash.Name, Permissions: result.EntityResult.Permissions, @@ -399,8 +403,8 @@ func TestIntegrationDashboard_Variables(t *testing.T) { }, Name: "variableUpdated", Options: &DashboardVariableOptionsInput{ - IgnoreTimeRange: true, - Excluded: true, + IgnoreTimeRange: &ignoreTimeRangeValue, + Excluded: &excludedValue, }, NRQLQuery: &DashboardVariableNRQLQueryInput{ AccountIDs: []int{testAccountID},