Skip to content

Commit c123f94

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
[OMG-1161] Update BDD tests for Teams API (DataDog#3161)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent 523254f commit c123f94

7 files changed

Lines changed: 256 additions & 6 deletions
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
2026-03-25T10:51:13.320Z

cassettes/features/v2/teams/Remove-a-user-from-a-team-returns-No-Content-response.yml

Lines changed: 144 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
2026-03-25T11:58:33.497Z

cassettes/features/v2/teams/Update-a-team-with-partial-update-returns-OK-response.yml

Lines changed: 66 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/v2/teams/DeleteTeamMembership.rb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,7 @@
55

66
# there is a valid "dd_team" in the system
77
DD_TEAM_DATA_ID = ENV["DD_TEAM_DATA_ID"]
8-
api_instance.delete_team_membership(DD_TEAM_DATA_ID, "user_id")
8+
9+
# there is a valid "user" in the system
10+
USER_DATA_ID = ENV["USER_DATA_ID"]
11+
api_instance.delete_team_membership(DD_TEAM_DATA_ID, USER_DATA_ID)
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Update a team with partial update returns "OK" response
2+
3+
require "datadog_api_client"
4+
api_instance = DatadogAPIClient::V2::TeamsAPI.new
5+
6+
# there is a valid "dd_team" in the system
7+
DD_TEAM_DATA_ATTRIBUTES_HANDLE = ENV["DD_TEAM_DATA_ATTRIBUTES_HANDLE"]
8+
DD_TEAM_DATA_ATTRIBUTES_NAME = ENV["DD_TEAM_DATA_ATTRIBUTES_NAME"]
9+
DD_TEAM_DATA_ID = ENV["DD_TEAM_DATA_ID"]
10+
11+
body = DatadogAPIClient::V2::TeamUpdateRequest.new({
12+
data: DatadogAPIClient::V2::TeamUpdate.new({
13+
attributes: DatadogAPIClient::V2::TeamUpdateAttributes.new({
14+
handle: DD_TEAM_DATA_ATTRIBUTES_HANDLE,
15+
name: "Example Team updated",
16+
}),
17+
type: DatadogAPIClient::V2::TeamType::TEAM,
18+
}),
19+
})
20+
p api_instance.update_team(DD_TEAM_DATA_ID, body)

features/v2/teams.feature

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -573,12 +573,14 @@ Feature: Teams
573573
When the request is sent
574574
Then the response status is 404 API error response.
575575

576-
@skip @team:DataDog/aaa-omg
576+
@team:DataDog/aaa-omg
577577
Scenario: Remove a user from a team returns "No Content" response
578578
Given new "DeleteTeamMembership" request
579579
And there is a valid "dd_team" in the system
580+
And there is a valid "user" in the system
581+
And there is a valid "team_membership" in the system
580582
And request contains "team_id" parameter from "dd_team.data.id"
581-
And request contains "user_id" parameter from "REPLACE.ME"
583+
And request contains "user_id" parameter from "user.data.id"
582584
When the request is sent
583585
Then the response status is 204 No Content
584586

@@ -607,11 +609,13 @@ Feature: Teams
607609
And the response "data.attributes.label" is equal to "New Label"
608610
And the response "data.attributes.url" is equal to "https://example.com"
609611

610-
@generated @skip @team:DataDog/aaa-omg
612+
@skip @team:DataDog/aaa-omg
611613
Scenario: Update a team returns "API error response." response
612614
Given new "UpdateTeam" request
613-
And request contains "team_id" parameter from "REPLACE.ME"
614-
And body with value {"data": {"attributes": {"avatar": "\ud83e\udd51", "banner": null, "handle": "example-team", "hidden_modules": [], "name": "Example Team", "visible_modules": []}, "relationships": {"team_links": {"data": [{"id": "f9bb8444-af7f-11ec-ac2c-da7ad0900001", "type": "team_links"}], "links": {"related": "/api/v2/team/c75a4a8e-20c7-11ee-a3a5-da7ad0900002/links"}}}, "type": "team"}}
615+
And there is a valid "dd_team" in the system
616+
And there is a valid "dd_team_2" in the system
617+
And request contains "team_id" parameter from "dd_team.data.id"
618+
And body with value {"data": {"attributes": {"handle": "{{dd_team_2.data.attributes.handle}}", "name": "{{dd_team.data.attributes.name}}"}, "type": "team"}}
615619
When the request is sent
616620
Then the response status is 409 API error response.
617621

@@ -631,6 +635,17 @@ Feature: Teams
631635
And the response "data.attributes.hidden_modules" is equal to ["m3"]
632636
And the response "data.attributes.visible_modules" is equal to ["m1", "m2"]
633637

638+
@team:DataDog/aaa-omg
639+
Scenario: Update a team with partial update returns "OK" response
640+
Given new "UpdateTeam" request
641+
And there is a valid "dd_team" in the system
642+
And request contains "team_id" parameter from "dd_team.data.id"
643+
And body with value {"data": {"attributes": {"handle": "{{dd_team.data.attributes.handle}}", "name": "{{dd_team.data.attributes.name}} updated"}, "type": "team"}}
644+
When the request is sent
645+
Then the response status is 200 OK
646+
And the response "data.attributes.name" is equal to "{{dd_team.data.attributes.name}} updated"
647+
And the response "data.attributes.handle" is equal to "{{dd_team.data.attributes.handle}}"
648+
634649
@team:DataDog/aaa-omg
635650
Scenario: Update a user's membership attributes on a team returns "API error response." response
636651
Given new "UpdateTeamMembership" request

0 commit comments

Comments
 (0)