From e4e2ec7fb6930c4b6cbe23e4d8acb7b561703079 Mon Sep 17 00:00:00 2001 From: chetan shanbag Date: Thu, 28 Jul 2022 12:29:13 +0530 Subject: [PATCH] Release 1.10.0 --- .github/workflows/sonarscanCI.yml | 4 +- BVSwift.xcodeproj/project.pbxproj | 12 ++ BVSwift/BVCommon/Logging/BVLogger.swift | 11 +- .../BVCommon/Networking/BVURLParameter.swift | 18 +++ BVSwift/BVCommon/Query/BVQueryable.swift | 8 + .../BVConversationsConstants.swift | 2 + .../Display/Fields/BVRelevancySortOrder.swift | 27 ++++ .../Display/Fields/Types/BVCostomSort.swift | 43 +++++ .../Fields/Types/BVRelevancySort.swift | 45 ++++++ .../Display/Types/BVReviewQuery.swift | 20 ++- .../Display/Types/BVReviewSearchQuery.swift | 24 +++ .../Display/BVReviewQueryTest.swift | 151 +++++++++++++++++- .../Display/BVReviewSearchQueryTest.swift | 3 + 13 files changed, 361 insertions(+), 7 deletions(-) create mode 100644 BVSwift/BVConversations/Display/Fields/BVRelevancySortOrder.swift create mode 100644 BVSwift/BVConversations/Display/Fields/Types/BVCostomSort.swift create mode 100644 BVSwift/BVConversations/Display/Fields/Types/BVRelevancySort.swift diff --git a/.github/workflows/sonarscanCI.yml b/.github/workflows/sonarscanCI.yml index 39cb40dd..55c9f49e 100644 --- a/.github/workflows/sonarscanCI.yml +++ b/.github/workflows/sonarscanCI.yml @@ -2,9 +2,9 @@ name: BVSwift Sonarqube Scan CI on: push: - branches: [ develop ] + branches: [ master ] pull_request: - branches: [ develop ] + branches: [ master ] env: SONAR_LOGIN: ${{ secrets.SONAR_TOKEN }} diff --git a/BVSwift.xcodeproj/project.pbxproj b/BVSwift.xcodeproj/project.pbxproj index 6b6a25de..8079b0d0 100644 --- a/BVSwift.xcodeproj/project.pbxproj +++ b/BVSwift.xcodeproj/project.pbxproj @@ -23,6 +23,9 @@ /* Begin PBXBuildFile section */ 422C3B212538524900080544 /* BVCommentsQueryTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 422C3B202538524900080544 /* BVCommentsQueryTest.swift */; }; 42C3C3B62507951C00305A4C /* BVIncentivizedStats.swift in Sources */ = {isa = PBXBuildFile; fileRef = 42C3C3B52507951C00305A4C /* BVIncentivizedStats.swift */; }; + 894615B228913424007B2138 /* BVCostomSort.swift in Sources */ = {isa = PBXBuildFile; fileRef = 894615B128913424007B2138 /* BVCostomSort.swift */; }; + 894615AE288FE812007B2138 /* BVRelevancySort.swift in Sources */ = {isa = PBXBuildFile; fileRef = 894615AD288FE812007B2138 /* BVRelevancySort.swift */; }; + 894615B0288FEB6B007B2138 /* BVRelevancySortOrder.swift in Sources */ = {isa = PBXBuildFile; fileRef = 894615AF288FEB6B007B2138 /* BVRelevancySortOrder.swift */; }; 895FB971279846BB0031DDED /* BVFeature.swift in Sources */ = {isa = PBXBuildFile; fileRef = 895FB970279846BB0031DDED /* BVFeature.swift */; }; 895FB972279847750031DDED /* BVFeedback.swift in Sources */ = {isa = PBXBuildFile; fileRef = 98686C852407112F00D67889 /* BVFeedback.swift */; }; 895FB97627994A300031DDED /* BVLanguageStat.swift in Sources */ = {isa = PBXBuildFile; fileRef = 895FB97527994A300031DDED /* BVLanguageStat.swift */; }; @@ -296,6 +299,9 @@ /* Begin PBXFileReference section */ 422C3B202538524900080544 /* BVCommentsQueryTest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BVCommentsQueryTest.swift; sourceTree = ""; }; 42C3C3B52507951C00305A4C /* BVIncentivizedStats.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BVIncentivizedStats.swift; sourceTree = ""; }; + 894615B128913424007B2138 /* BVCostomSort.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BVCostomSort.swift; sourceTree = ""; }; + 894615AD288FE812007B2138 /* BVRelevancySort.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BVRelevancySort.swift; sourceTree = ""; }; + 894615AF288FEB6B007B2138 /* BVRelevancySortOrder.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BVRelevancySortOrder.swift; sourceTree = ""; }; 895FB970279846BB0031DDED /* BVFeature.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BVFeature.swift; sourceTree = ""; }; 895FB97527994A300031DDED /* BVLanguageStat.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BVLanguageStat.swift; sourceTree = ""; }; 899900082706E45F0005275A /* BVFeatureQueryTest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BVFeatureQueryTest.swift; sourceTree = ""; }; @@ -976,6 +982,7 @@ children = ( 98686C342407109800D67889 /* BVConversationsFilterOperator.swift */, 98686C352407109900D67889 /* BVConversationsSortOrder.swift */, + 894615AF288FEB6B007B2138 /* BVRelevancySortOrder.swift */, B5B31EB520B373A3002DBEC8 /* Types */, ); path = Fields; @@ -1013,6 +1020,8 @@ 895FB97527994A300031DDED /* BVLanguageStat.swift */, 89F1351D27FD92D4006BBBF5 /* BVSecondaryRatingStat.swift */, 89E3106E27F4C9F700D42042 /* BVTagStats.swift */, + 894615B128913424007B2138 /* BVCostomSort.swift */, + 894615AD288FE812007B2138 /* BVRelevancySort.swift */, ); path = Types; sourceTree = ""; @@ -1507,11 +1516,13 @@ 98686CAB2407113100D67889 /* BVDimensionElement.swift in Sources */, 98686CF92407120700D67889 /* BVCurationsFeedItem.swift in Sources */, 98686CEF2407120700D67889 /* BVCurationsCustomContent.swift in Sources */, + 894615B228913424007B2138 /* BVCostomSort.swift in Sources */, 98686C0B2407100900D67889 /* BVURLRequestable.swift in Sources */, 98686C56240710AE00D67889 /* BVProductStat.swift in Sources */, 98686D352407132000D67889 /* BVRecommendationsProfileInclude.swift in Sources */, 98686CFD2407120700D67889 /* BVCurationsLink.swift in Sources */, 98686CA62407113100D67889 /* BVProductStatistics.swift in Sources */, + 894615B0288FEB6B007B2138 /* BVRelevancySortOrder.swift in Sources */, 98686D2B240712F700D67889 /* BVRecommendationsError.swift in Sources */, 98686D362407132000D67889 /* BVRecommendationsProfilePurpose.swift in Sources */, 98686D2A240712F700D67889 /* BVRecommendationsConfiguration.swift in Sources */, @@ -1595,6 +1606,7 @@ 98686D1E240712BB00D67889 /* BVWeak.swift in Sources */, 98686C332407108600D67889 /* BVConversationsQueryResponse.swift in Sources */, 98686CD9240711EE00D67889 /* BVCurationsFeedItemQuery.swift in Sources */, + 894615AE288FE812007B2138 /* BVRelevancySort.swift in Sources */, 98686CCD240711B800D67889 /* BVCurationsConstants.swift in Sources */, 98686D392407133500D67889 /* BVRecommendationsProfileQuery.swift in Sources */, 9F51CA49240CD1150043AED5 /* BVReviewHighlights.swift in Sources */, diff --git a/BVSwift/BVCommon/Logging/BVLogger.swift b/BVSwift/BVCommon/Logging/BVLogger.swift index 7ddc264c..54c7b4f0 100644 --- a/BVSwift/BVCommon/Logging/BVLogger.swift +++ b/BVSwift/BVCommon/Logging/BVLogger.swift @@ -73,11 +73,16 @@ public class BVLogger { DispatchQueue(label: "com.bvswift.BVLogger.listenerQueue") private var listeners = [BVLogNotifier]() + + private var _logger : OSLog? = nil @available(iOS 10.0, *) - lazy private var logger = { - return OSLog(subsystem: "com.bvswift.BVLogger", category: "Module") - }() + private var logger:OSLog { + if _logger == nil { + _logger = OSLog(subsystem: "com.bvswift.BVLogger", category: "Module") + } + return _logger! + } private var internalLogLevel: LogLevel = .error diff --git a/BVSwift/BVCommon/Networking/BVURLParameter.swift b/BVSwift/BVCommon/Networking/BVURLParameter.swift index 9b225232..d44a0ac3 100644 --- a/BVSwift/BVCommon/Networking/BVURLParameter.swift +++ b/BVSwift/BVCommon/Networking/BVURLParameter.swift @@ -40,6 +40,10 @@ internal indirect enum BVURLParameter: BVParameter { CustomStringConvertible, CustomStringConvertible, BVURLParameter?) + case customSort( + BVQuerySort, + CustomStringConvertible, + BVURLParameter?) var name: String { switch self { @@ -70,6 +74,8 @@ internal indirect enum BVURLParameter: BVParameter { return type(of: stats).statPrefix.escaping() case .unsafe(let field, _, _): return field.description.escaping() + case .customSort(let sort, _, _): + return type(of: sort).sortPrefix.escaping() } } @@ -119,6 +125,8 @@ internal indirect enum BVURLParameter: BVParameter { self = .stats(stats, child) case let .unsafe(field, value, _): self = .unsafe(field, value, child) + case let .customSort(sort, op, _): + self = .customSort(sort, op, child) } } @@ -186,6 +194,12 @@ internal indirect enum BVURLParameter: BVParameter { return stats.description.escaping() case .unsafe(_, let value, _): return value.description.escaping() + case .customSort(let sort, let order, _): + let separator = type(of: sort).sortValueSeparator + return + [sort.description.escaping(), + order.description].joined(separator: separator) + } } @@ -209,6 +223,8 @@ internal indirect enum BVURLParameter: BVParameter { return .stats(stats, nil) case let .unsafe(field, value, _): return .unsafe(field, value, nil) + case let .customSort(sort, op, _): + return .customSort(sort, op, nil) } } @@ -232,6 +248,8 @@ internal indirect enum BVURLParameter: BVParameter { return child case .unsafe(_, _, let child): return child + case .customSort(_, _, let child): + return child } } diff --git a/BVSwift/BVCommon/Query/BVQueryable.swift b/BVSwift/BVCommon/Query/BVQueryable.swift index 48b314dd..f7330f95 100644 --- a/BVSwift/BVCommon/Query/BVQueryable.swift +++ b/BVSwift/BVCommon/Query/BVQueryable.swift @@ -92,6 +92,14 @@ public protocol BVQuerySortable { func sort(_ on: Sort, order: Order) -> Self } +/// Protocol definition for the behavior of adding sort filters +public protocol BVQueryCustomSortable { + associatedtype Sort: BVQuerySort + + func coustomSort(_ on: Sort, contentLocales: [String]) -> Self +} + + /// Protocol definition for the behavior of adding stat filters public protocol BVQueryStatable { associatedtype Stat: BVQueryStat diff --git a/BVSwift/BVConversations/BVConversationsConstants.swift b/BVSwift/BVConversations/BVConversationsConstants.swift index 81eb0eae..4e21bbd2 100644 --- a/BVSwift/BVConversations/BVConversationsConstants.swift +++ b/BVSwift/BVConversations/BVConversationsConstants.swift @@ -210,6 +210,7 @@ internal struct BVConversationsConstants { internal struct BVConversationsSortOrder { static let ascending: String = "asc" static let descending: String = "desc" + static let orderTwo = "a2" } internal struct BVNativeReviews { @@ -368,6 +369,7 @@ internal struct BVConversationsConstants { static let submissionTime: String = "SubmissionTime" static let totalCommentCount: String = "TotalCommentCount" static let totalFeedbackCount: String = "TotalFeedbackCount" + static let relavancy: String = "relevancy" static let totalNegativeFeedbackCount: String = "TotalNegativeFeedbackCount" static let totalPositiveFeedbackCount: String = diff --git a/BVSwift/BVConversations/Display/Fields/BVRelevancySortOrder.swift b/BVSwift/BVConversations/Display/Fields/BVRelevancySortOrder.swift new file mode 100644 index 00000000..e72b27a7 --- /dev/null +++ b/BVSwift/BVConversations/Display/Fields/BVRelevancySortOrder.swift @@ -0,0 +1,27 @@ +// +// +// BVRelavancySortOrder.swift +// BVSwift +// +// Copyright © 2022 Bazaarvoice. All rights reserved. +// + +import Foundation +/// An enum that represents a sorting mechanism that allows for relevancy sort type by +public enum BVRelencySortType: BVQuerySortOrder { + case a2 + + public var description: String { + return internalDescription + } +} + +extension BVRelencySortType: BVConversationsQueryValue { + var internalDescription: String { + switch self { + case .a2: + return BVConversationsConstants.BVConversationsSortOrder.orderTwo + } + } +} + diff --git a/BVSwift/BVConversations/Display/Fields/Types/BVCostomSort.swift b/BVSwift/BVConversations/Display/Fields/Types/BVCostomSort.swift new file mode 100644 index 00000000..649f8a7d --- /dev/null +++ b/BVSwift/BVConversations/Display/Fields/Types/BVCostomSort.swift @@ -0,0 +1,43 @@ +// +// +// BVCostomSort.swift +// BVSwift +// +// Copyright © 2022 Bazaarvoice. All rights reserved. +// + +import Foundation +/// An enum that represents the possible custom sorting comparators to filter on for +/// the BVReviewQuery +/// - Note: +/// \ +/// Used for conformance with the BVQuerySortable protocol. +public enum BVCustomSort: BVQuerySort { + + case contentLocale + + public static var sortPrefix: String { + return BVConversationsConstants.BVQuerySort.defaultField + } + + public static var sortTypeSeparator: String { + return BVConversationsConstants.BVQuerySort.typeSeparatorField + } + + public static var sortValueSeparator: String { + return BVConversationsConstants.BVQuerySort.valueSeparatorField + } + + public var description: String { + return internalDescription + } +} + +extension BVCustomSort: BVConversationsQueryValue { + var internalDescription: String { + switch self { + case .contentLocale: + return BVConversationsConstants.BVReviews.Keys.contentLocale + } + } +} diff --git a/BVSwift/BVConversations/Display/Fields/Types/BVRelevancySort.swift b/BVSwift/BVConversations/Display/Fields/Types/BVRelevancySort.swift new file mode 100644 index 00000000..2b09f4b1 --- /dev/null +++ b/BVSwift/BVConversations/Display/Fields/Types/BVRelevancySort.swift @@ -0,0 +1,45 @@ +// +// +// BVRelavancySort.swift +// BVSwift +// +// Copyright © 2022 Bazaarvoice. All rights reserved. +// + +import Foundation + +/// An enum that represents the possible relevancy sorting comparators to filter on for +/// the BVReviewQuery +/// - Note: +/// \ +/// Used for conformance with the BVQuerySortable protocol. +public enum BVRelevancySort: BVQuerySort { + + case relevancy + + public static var sortPrefix: String { + return BVConversationsConstants.BVQuerySort.defaultField + } + + public static var sortTypeSeparator: String { + return BVConversationsConstants.BVQuerySort.typeSeparatorField + } + + public static var sortValueSeparator: String { + return BVConversationsConstants.BVQuerySort.valueSeparatorField + } + + public var description: String { + return internalDescription + } +} + +extension BVRelevancySort: BVConversationsQueryValue { + var internalDescription: String { + switch self { + case .relevancy: + return BVConversationsConstants.BVReviews.Keys.relavancy + } + } +} + diff --git a/BVSwift/BVConversations/Display/Types/BVReviewQuery.swift b/BVSwift/BVConversations/Display/Types/BVReviewQuery.swift index 70a55969..2750905a 100644 --- a/BVSwift/BVConversations/Display/Types/BVReviewQuery.swift +++ b/BVSwift/BVConversations/Display/Types/BVReviewQuery.swift @@ -217,13 +217,31 @@ extension BVReviewQuery: BVQueryIncludeable { extension BVReviewQuery: BVQuerySortable { public typealias Sort = BVReviewSort public typealias Order = BVConversationsSortOrder - + public typealias customSortOptions = BVCustomSort + public typealias RelavancySort = BVRelevancySort + public typealias RelanvancySortType = BVRelencySortType + @discardableResult public func sort(_ on: Sort, order: Order) -> Self { let internalSort: BVURLParameter = .sort(on, order, nil) add(internalSort) return self } + + @discardableResult + public func sort(_ on: customSortOptions, contentLocales: [String]) -> Self { + let contentLocale: String = (contentLocales.map{String($0)}).joined(separator: ",") + let internalSort: BVURLParameter = .customSort(on, contentLocale, nil) + add(internalSort) + return self + } + + @discardableResult + public func sort(_ on: RelavancySort, order: RelanvancySortType) -> Self { + let internalSort: BVURLParameter = .sort(on, order, nil) + add(internalSort) + return self + } } // MARK: - BVReviewQuery: BVQueryStatable diff --git a/BVSwift/BVConversations/Display/Types/BVReviewSearchQuery.swift b/BVSwift/BVConversations/Display/Types/BVReviewSearchQuery.swift index 52f7b74d..5ff8287e 100644 --- a/BVSwift/BVConversations/Display/Types/BVReviewSearchQuery.swift +++ b/BVSwift/BVConversations/Display/Types/BVReviewSearchQuery.swift @@ -210,6 +210,30 @@ extension BVReviewSearchQuery: BVQueryFilteredStatable { } } +// MARK: - BVReviewSearchQuery: BVQuerySortable +extension BVReviewSearchQuery: BVQuerySortable { + public typealias Sort = BVReviewSort + public typealias Order = BVConversationsSortOrder + public typealias RelavancySort = BVRelevancySort + public typealias RelanvancySortType = BVRelencySortType + + + + @discardableResult + public func sort(_ on: Sort, order: Order) -> Self { + let internalSort: BVURLParameter = .sort(on, order, nil) + add(internalSort) + return self + } + + @discardableResult + public func sort(_ on: RelavancySort, order: RelanvancySortType) -> Self { + let internalSort: BVURLParameter = .sort(on, order, nil) + add(internalSort) + return self + } +} + // MARK: - BVReviewSearchQuery: BVQueryIncludeable extension BVReviewSearchQuery: BVQueryIncludeable { public typealias Include = BVReviewInclude diff --git a/BVSwiftTests/BVConversations/Display/BVReviewQueryTest.swift b/BVSwiftTests/BVConversations/Display/BVReviewQueryTest.swift index edce7081..8a75c6af 100644 --- a/BVSwiftTests/BVConversations/Display/BVReviewQueryTest.swift +++ b/BVSwiftTests/BVConversations/Display/BVReviewQueryTest.swift @@ -103,6 +103,19 @@ class BVReviewQueryTest: XCTestCase { configType: .staging(clientId: "testcustomermobilesdk"), analyticsConfig: analyticsConfig) }() + + private static var relevancySortConfig: BVConversationsConfiguration = + { () -> BVConversationsConfiguration in + + let analyticsConfig: BVAnalyticsConfiguration = + .dryRun( + configType: .staging(clientId: "mobile_test_customer_stg")) + + return BVConversationsConfiguration.display( + clientKey: "caht73JSvhpl41pvD8vrIIPjLeMR0oPV6vMyd15lM2sig", + configType: .staging(clientId: "mobile_test_customer_stg"), + analyticsConfig: analyticsConfig) + }() private static var privateSession:URLSession = { return URLSession(configuration: .default) @@ -133,6 +146,8 @@ class BVReviewQueryTest: XCTestCase { .filter((.contextDataValue(id: "Age", value: "17orUnder"), .equalTo)) .feature("satisfaction") .filter((.secondaryRating(id: "Quality", value: "5"), .equalTo)) + .sort(.contentLocale, contentLocales: ["en_US", "fr_FR"]) + .sort(.relevancy, order: .a2) guard let url = reviewQuery.request?.url else { XCTFail() @@ -151,7 +166,10 @@ class BVReviewQueryTest: XCTestCase { "ContextDataValue_Age:eq:17orUnder")) XCTAssertTrue(url.absoluteString.contains( "SecondaryRating_Quality:eq:5")) - + XCTAssertTrue(url.absoluteString.contains( + "Sort=ContentLocale:en_US,fr_FR")) + XCTAssertTrue(url.absoluteString.contains("Sort=relevancy:a2")) + } func testReviewQueryDisplay() { @@ -1330,4 +1348,135 @@ class BVReviewQueryTest: XCTestCase { error, "Something went horribly wrong, request took too long.") } } + + func testReviewRelevancySort() { + + let expectation = self.expectation(description: "testReviewQueryDisplay") + + let reviewQuery = BVReviewQuery(productId: "product1", limit: 10, offset: 0) + .sort(.relevancy, order: .a2) + .configure(BVReviewQueryTest.relevancySortConfig) + .handler { (response: BVConversationsQueryResponse) in + + if case .failure(let error) = response { + print(error) + XCTFail() + expectation.fulfill() + return + } + + guard case let .success(_, reviews) = response else { + XCTFail() + expectation.fulfill() + return + } + XCTAssertEqual(reviews.count, 10) + XCTAssertEqual(reviews.first?.reviewId, "34016202") + expectation.fulfill() + } + + guard let req = reviewQuery.request else { + XCTFail() + expectation.fulfill() + return + } + + print(req) + + reviewQuery.async() + + self.waitForExpectations(timeout: 20) { (error) in + XCTAssertNil( + error, "Something went horribly wrong, request took too long.") + } + } + + func testReviewCustomContentLocaleSort() { + + let expectation = self.expectation(description: "testReviewQueryDisplay") + + let reviewQuery = BVReviewQuery(productId: "product1", limit: 20, offset: 0) + .sort(.contentLocale, contentLocales: ["es_US","en_US"]) + .configure(BVReviewQueryTest.relevancySortConfig) + .handler { (response: BVConversationsQueryResponse) in + + if case .failure(let error) = response { + print(error) + XCTFail() + expectation.fulfill() + return + } + + guard case let .success(_, reviews) = response else { + XCTFail() + expectation.fulfill() + return + } + + XCTAssertEqual(reviews.count, 20) + + let ContentLocales = reviews.map { review in + review.contentLocale + } + + XCTAssertTrue(ContentLocales.firstIndex(of: "es_US")! < ContentLocales.firstIndex(of: "en_US")!); + expectation.fulfill() + } + + guard let req = reviewQuery.request else { + XCTFail() + expectation.fulfill() + return + } + + print(req) + + reviewQuery.async() + + self.waitForExpectations(timeout: 20) { (error) in + XCTAssertNil( + error, "Something went horribly wrong, request took too long.") + } + } + + func testReviewCustomContentLocaleSortErrorMoreValues() { + + let expectation = self.expectation(description: "testReviewQueryDisplay") + + let reviewQuery = BVReviewQuery(productId: "product1", limit: 20, offset: 0) + .sort(.contentLocale, contentLocales: ["fr_FR","en_GB","en_US","en_ZH","en_CA","en_DE"]) + .configure(BVReviewQueryTest.relevancySortConfig) + .handler { (response: BVConversationsQueryResponse) in + + if case .failure(let error) = response { + print(error) + expectation.fulfill() + return + } + + guard case let .success(_,reviews) = response else { + XCTFail() + expectation.fulfill() + return + } + XCTAssertNil(reviews) + expectation.fulfill() + + } + + guard let req = reviewQuery.request else { + XCTFail() + expectation.fulfill() + return + } + + print(req) + + reviewQuery.async() + + self.waitForExpectations(timeout: 20) { (error) in + XCTAssertNil( + error, "Something went horribly wrong, request took too long.") + } + } } diff --git a/BVSwiftTests/BVConversations/Display/BVReviewSearchQueryTest.swift b/BVSwiftTests/BVConversations/Display/BVReviewSearchQueryTest.swift index 0bd08717..b01093e3 100644 --- a/BVSwiftTests/BVConversations/Display/BVReviewSearchQueryTest.swift +++ b/BVSwiftTests/BVConversations/Display/BVReviewSearchQueryTest.swift @@ -78,6 +78,7 @@ class BVReviewSearchQueryTest: XCTestCase { (.categoryAncestorId("testID4"), .notEqualTo), (.categoryAncestorId("testID5"), .notEqualTo)) .feature("satisfaction") + .sort(.relevancy, order: .a2) guard let url = reviewSearchQuery.request?.url else { XCTFail() @@ -92,6 +93,8 @@ class BVReviewSearchQueryTest: XCTestCase { "CategoryAncestorId:neq:testID4,testID5")) XCTAssertTrue(url.absoluteString.contains( "Feature=satisfaction")) + XCTAssertTrue(url.absoluteString.contains( + "Sort=relevancy:a2")) } func testReviewSearchQueryDisplay() {