File tree Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Original file line number Diff line number Diff line change 1+ package github
2+
3+ import (
4+ "testing"
5+
6+ "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
7+ )
8+
9+ func TestResourceGithubActionsSecretValidation (t * testing.T ) {
10+ resource := resourceGithubActionsSecret ()
11+
12+ // Verify the resource has an Update function
13+ if resource .Update == nil {
14+ t .Fatal ("github_actions_secret resource must have an Update function to handle destroy_on_drift field changes" )
15+ }
16+
17+ // Verify destroy_on_drift field exists and is configured correctly
18+ destroyOnDriftSchema , exists := resource .Schema ["destroy_on_drift" ]
19+ if ! exists {
20+ t .Fatal ("destroy_on_drift field should exist in schema" )
21+ }
22+
23+ if destroyOnDriftSchema .Type != schema .TypeBool {
24+ t .Error ("destroy_on_drift should be TypeBool" )
25+ }
26+
27+ if ! destroyOnDriftSchema .Optional {
28+ t .Error ("destroy_on_drift should be Optional" )
29+ }
30+
31+ if destroyOnDriftSchema .ForceNew {
32+ t .Error ("destroy_on_drift should not be ForceNew when Update function exists" )
33+ }
34+ }
You can’t perform that action at this time.
0 commit comments