From 2071b971ae32d2e257abb1c3c1f28f12ec1b9319 Mon Sep 17 00:00:00 2001 From: box-sdk-build <94016436+box-sdk-build@users.noreply.github.com> Date: Wed, 10 Jul 2024 15:01:49 +0200 Subject: [PATCH] test: Improve term of service test reliability (box/box-codegen#522) (#155) --- .codegen.json | 2 +- .../TermsOfServices/TermsOfServicesManagerTests.swift | 10 +++++----- docs/TermsOfServices.md | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.codegen.json b/.codegen.json index 0d4363db..aa23fee4 100644 --- a/.codegen.json +++ b/.codegen.json @@ -1 +1 @@ -{ "engineHash": "62a25a4", "specHash": "e95d6fa", "version": "0.3.0" } +{ "engineHash": "5a07c4a", "specHash": "e95d6fa", "version": "0.3.0" } diff --git a/Tests/TermsOfServices/TermsOfServicesManagerTests.swift b/Tests/TermsOfServices/TermsOfServicesManagerTests.swift index 71051619..564e72f2 100644 --- a/Tests/TermsOfServices/TermsOfServicesManagerTests.swift +++ b/Tests/TermsOfServices/TermsOfServicesManagerTests.swift @@ -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) } diff --git a/docs/TermsOfServices.md b/docs/TermsOfServices.md index 3865bf4f..437683d3 100644 --- a/docs/TermsOfServices.md +++ b/docs/TermsOfServices.md @@ -104,7 +104,7 @@ See the endpoint docs at ``` -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