@@ -193,6 +193,83 @@ func TestAccGithubTeamRemovesDefaultMaintainer(t *testing.T) {
193193
194194}
195195
196+ func TestAccGithubTeamNotificationSetting (t * testing.T ) {
197+ randomID := acctest .RandStringFromCharSet (5 , acctest .CharSetAlphaNum )
198+
199+ t .Run ("creates teams with different notification settings" , func (t * testing.T ) {
200+
201+ config := fmt .Sprintf (`
202+ resource "github_team" "test_default" {
203+ name = "tf-acc-default-%s"
204+ }
205+
206+ resource "github_team" "test_enabled" {
207+ name = "tf-acc-enabled-%s"
208+ notification_setting = "notifications_enabled"
209+ }
210+
211+ resource "github_team" "test_disabled" {
212+ name = "tf-acc-disabled-%s"
213+ notification_setting = "notifications_disabled"
214+ }
215+ ` , randomID , randomID , randomID )
216+
217+ configUpdated := fmt .Sprintf (`
218+ resource "github_team" "test_default" {
219+ name = "tf-acc-default-%s"
220+ }
221+
222+ resource "github_team" "test_enabled" {
223+ name = "tf-acc-enabled-%s"
224+ notification_setting = "notifications_disabled"
225+ }
226+
227+ resource "github_team" "test_disabled" {
228+ name = "tf-acc-disabled-%s"
229+ notification_setting = "notifications_enabled"
230+ }
231+ ` , randomID , randomID , randomID )
232+
233+ testCase := func (t * testing.T , mode string ) {
234+ resource .Test (t , resource.TestCase {
235+ PreCheck : func () { skipUnlessMode (t , mode ) },
236+ Providers : testAccProviders ,
237+ Steps : []resource.TestStep {
238+ {
239+ Config : config ,
240+ Check : resource .ComposeTestCheckFunc (
241+ resource .TestCheckResourceAttr ("github_team.test_default" , "notification_setting" , "notifications_enabled" ),
242+ resource .TestCheckResourceAttr ("github_team.test_enabled" , "notification_setting" , "notifications_enabled" ),
243+ resource .TestCheckResourceAttr ("github_team.test_disabled" , "notification_setting" , "notifications_disabled" ),
244+ ),
245+ },
246+ {
247+ Config : configUpdated ,
248+ Check : resource .ComposeTestCheckFunc (
249+ resource .TestCheckResourceAttr ("github_team.test_default" , "notification_setting" , "notifications_enabled" ),
250+ resource .TestCheckResourceAttr ("github_team.test_enabled" , "notification_setting" , "notifications_disabled" ),
251+ resource .TestCheckResourceAttr ("github_team.test_disabled" , "notification_setting" , "notifications_enabled" ),
252+ ),
253+ },
254+ },
255+ })
256+ }
257+
258+ t .Run ("with an anonymous account" , func (t * testing.T ) {
259+ t .Skip ("anonymous account not supported for this operation" )
260+ })
261+
262+ t .Run ("with an individual account" , func (t * testing.T ) {
263+ t .Skip ("individual account not supported for this operation" )
264+ })
265+
266+ t .Run ("with an organization account" , func (t * testing.T ) {
267+ testCase (t , organization )
268+ })
269+
270+ })
271+ }
272+
196273func TestAccGithubTeamUpdateName (t * testing.T ) {
197274 randomID := acctest .RandStringFromCharSet (5 , acctest .CharSetAlphaNum )
198275
0 commit comments