@@ -859,6 +859,47 @@ func TestAccGithubRepositoryPages(t *testing.T) {
859859
860860 })
861861
862+ t .Run ("expand Pages configuration with workflow" , func (t * testing.T ) {
863+ input := []interface {}{map [string ]interface {}{
864+ "build_type" : "workflow" ,
865+ "source" : []interface {}{map [string ]interface {}{}},
866+ }}
867+
868+ pages := expandPages (input )
869+ if pages == nil {
870+ t .Fatal ("pages is nil" )
871+ }
872+ if pages .GetBuildType () != "workflow" {
873+ t .Errorf ("got %q; want %q" , pages .GetBuildType (), "workflow" )
874+ }
875+ if pages .GetSource ().GetBranch () != "main" {
876+ t .Errorf ("got %q; want %q" , pages .GetSource ().GetBranch (), "main" )
877+ }
878+ })
879+
880+ t .Run ("expand Pages configuration with source" , func (t * testing.T ) {
881+ input := []interface {}{map [string ]interface {}{
882+ "build_type" : "legacy" ,
883+ "source" : []interface {}{map [string ]interface {}{
884+ "branch" : "main" ,
885+ "path" : "/docs" ,
886+ }},
887+ }}
888+
889+ pages := expandPages (input )
890+ if pages == nil {
891+ t .Fatal ("pages is nil" )
892+ }
893+ if pages .GetBuildType () != "legacy" {
894+ t .Errorf ("got %q; want %q" , pages .GetBuildType (), "legacy" )
895+ }
896+ if pages .GetSource ().GetBranch () != "main" {
897+ t .Errorf ("got %q; want %q" , pages .GetSource ().GetBranch (), "main" )
898+ }
899+ if pages .GetSource ().GetPath () != "/docs" {
900+ t .Errorf ("got %q; want %q" , pages .GetSource ().GetPath (), "/docs" )
901+ }
902+ })
862903}
863904
864905func TestAccGithubRepositorySecurity (t * testing.T ) {
0 commit comments