Skip to content

Commit

Permalink
test: Improve term of service test reliability (box/box-codegen#522) (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
box-sdk-build authored Jul 10, 2024
1 parent c224417 commit 2071b97
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .codegen.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{ "engineHash": "62a25a4", "specHash": "e95d6fa", "version": "0.3.0" }
{ "engineHash": "5a07c4a", "specHash": "e95d6fa", "version": "0.3.0" }
10 changes: 5 additions & 5 deletions Tests/TermsOfServices/TermsOfServicesManagerTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ class TermsOfServicesManagerTests: XCTestCase {

public func testGetTermsOfServices() async throws {
let tos: TermsOfService = try await CommonsManager().getOrCreateTermsOfServices()
let updatedTos1: TermsOfService = try await client.termsOfServices.updateTermsOfServiceById(termsOfServiceId: tos.id, requestBody: UpdateTermsOfServiceByIdRequestBody(status: UpdateTermsOfServiceByIdRequestBodyStatusField.enabled, text: "Enabled TOS"))
XCTAssertTrue(Utils.Strings.toString(value: updatedTos1.status) == "enabled")
XCTAssertTrue(updatedTos1.text == "Enabled TOS")
let updatedTos2: TermsOfService = try await client.termsOfServices.updateTermsOfServiceById(termsOfServiceId: tos.id, requestBody: UpdateTermsOfServiceByIdRequestBody(status: UpdateTermsOfServiceByIdRequestBodyStatusField.disabled, text: "Disabled TOS"))
let updatedTos1: TermsOfService = try await client.termsOfServices.updateTermsOfServiceById(termsOfServiceId: tos.id, requestBody: UpdateTermsOfServiceByIdRequestBody(status: UpdateTermsOfServiceByIdRequestBodyStatusField.disabled, text: "TOS"))
XCTAssertTrue(Utils.Strings.toString(value: updatedTos1.status) == "disabled")
XCTAssertTrue(updatedTos1.text == "TOS")
let updatedTos2: TermsOfService = try await client.termsOfServices.updateTermsOfServiceById(termsOfServiceId: tos.id, requestBody: UpdateTermsOfServiceByIdRequestBody(status: UpdateTermsOfServiceByIdRequestBodyStatusField.disabled, text: "Updated TOS"))
XCTAssertTrue(Utils.Strings.toString(value: updatedTos2.status) == "disabled")
XCTAssertTrue(updatedTos2.text == "Disabled TOS")
XCTAssertTrue(updatedTos2.text == "Updated TOS")
let listTos: TermsOfServices = try await client.termsOfServices.getTermsOfService()
XCTAssertTrue(listTos.totalCount! > 0)
}
Expand Down
2 changes: 1 addition & 1 deletion docs/TermsOfServices.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ See the endpoint docs at

<!-- sample put_terms_of_services_id -->
```
try await client.termsOfServices.updateTermsOfServiceById(termsOfServiceId: tos.id, requestBody: UpdateTermsOfServiceByIdRequestBody(status: UpdateTermsOfServiceByIdRequestBodyStatusField.disabled, text: "Disabled TOS"))
try await client.termsOfServices.updateTermsOfServiceById(termsOfServiceId: tos.id, requestBody: UpdateTermsOfServiceByIdRequestBody(status: UpdateTermsOfServiceByIdRequestBodyStatusField.disabled, text: "Updated TOS"))
```

### Arguments
Expand Down

0 comments on commit 2071b97

Please sign in to comment.