Skip to content

Commit 172b9be

Browse files
committed
fix tests and add changelog
1 parent e23eaa5 commit 172b9be

File tree

4 files changed

+23
-43
lines changed

4 files changed

+23
-43
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,10 @@ __New features__
99
- Add toCLLocation and toCLLocationCoordinate2D computed properties to ParseGeoPoint, deprecate toCLLocation() and toCLLocationCoordinate2D() ([#366](https://github.com/parse-community/Parse-Swift/pull/366)), thanks to [Corey Baker](https://github.com/cbaker6).
1010
- Add query computed property to ParseObject ([#365](https://github.com/parse-community/Parse-Swift/pull/365)), thanks to [Corey Baker](https://github.com/cbaker6).
1111
- Add macCatalyst to SPM ([#363](https://github.com/parse-community/Parse-Swift/pull/363)), thanks to [Corey Baker](https://github.com/cbaker6).
12-
- Add includeAll computed property to Query and deprecate includeAll(). Add an order() method to Query that excepts a variadic list as input ([#362](https://github.com/parse-community/Parse-Swift/pull/362)), thanks to [Corey Baker](https://github.com/cbaker6).
12+
- Add an order() method to Query that excepts a variadic list as input ([#362](https://github.com/parse-community/Parse-Swift/pull/362)), thanks to [Corey Baker](https://github.com/cbaker6).
1313

1414
__Improvements__
15+
- Allow includeAll key to be sent with additional include keys. When fetching, if the include argument is specified, convert it to a Set to prevent duplicate keys from being sent to the server ([#367](https://github.com/parse-community/Parse-Swift/pull/367)), thanks to [Corey Baker](https://github.com/cbaker6).
1516
- Allow LiveQuery client to be set using ParseLiveQuery.defaultClient and deprecate ParseLiveQuery.setDefault(). Show usage of deprecated code as warnings during compile time and suggest changes ([#360](https://github.com/parse-community/Parse-Swift/pull/360)), thanks to [Corey Baker](https://github.com/cbaker6).
1617

1718
### 4.4.0

Tests/ParseSwiftTests/ParseInstallationTests.swift

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -777,21 +777,14 @@ class ParseInstallationTests: XCTestCase { // swiftlint:disable:this type_body_l
777777
XCTAssertNotNil(command)
778778
XCTAssertEqual(command.path.urlComponent, "/installations/\(objectId)")
779779
XCTAssertEqual(command.method, API.Method.GET)
780-
XCTAssertEqual(command.params, includeExpected)
781-
XCTAssertNil(command.body)
782-
783-
// swiftlint:disable:next line_length
784-
guard let urlExpected = URL(string: "http://localhost:1337/1/installations/yarr?include=%5B%22yolo%22,%20%22test%22%5D") else {
785-
XCTFail("Should have unwrapped")
786-
return
787-
}
788-
let request = command.prepareURLRequest(options: [])
789-
switch request {
790-
case .success(let url):
791-
XCTAssertEqual(url.url, urlExpected)
792-
case .failure(let error):
793-
XCTFail(error.localizedDescription)
780+
XCTAssertEqual(command.params?.keys.first, includeExpected.keys.first)
781+
if let value = command.params?.values.first,
782+
let includeValue = value {
783+
XCTAssertTrue(includeValue.contains("\"yolo\""))
784+
} else {
785+
XCTFail("Should have unwrapped value")
794786
}
787+
XCTAssertNil(command.body)
795788
} catch {
796789
XCTFail(error.localizedDescription)
797790
}

Tests/ParseSwiftTests/ParseObjectTests.swift

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -456,21 +456,14 @@ class ParseObjectTests: XCTestCase { // swiftlint:disable:this type_body_length
456456
XCTAssertNotNil(command)
457457
XCTAssertEqual(command.path.urlComponent, "/classes/\(className)/\(objectId)")
458458
XCTAssertEqual(command.method, API.Method.GET)
459-
XCTAssertEqual(command.params, includeExpected)
460-
XCTAssertNil(command.body)
461-
462-
// swiftlint:disable:next line_length
463-
guard let urlExpected = URL(string: "http://localhost:1337/1/classes/GameScore/yarr?include=%5B%22yolo%22,%20%22test%22%5D") else {
464-
XCTFail("Should have unwrapped")
465-
return
466-
}
467-
let request = command.prepareURLRequest(options: [])
468-
switch request {
469-
case .success(let url):
470-
XCTAssertEqual(url.url, urlExpected)
471-
case .failure(let error):
472-
XCTFail(error.localizedDescription)
459+
XCTAssertEqual(command.params?.keys.first, includeExpected.keys.first)
460+
if let value = command.params?.values.first,
461+
let includeValue = value {
462+
XCTAssertTrue(includeValue.contains("\"yolo\""))
463+
} else {
464+
XCTFail("Should have unwrapped value")
473465
}
466+
XCTAssertNil(command.body)
474467
} catch {
475468
XCTFail(error.localizedDescription)
476469
}

Tests/ParseSwiftTests/ParseUserTests.swift

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -213,21 +213,14 @@ class ParseUserTests: XCTestCase { // swiftlint:disable:this type_body_length
213213
XCTAssertNotNil(command)
214214
XCTAssertEqual(command.path.urlComponent, "/users/\(objectId)")
215215
XCTAssertEqual(command.method, API.Method.GET)
216-
XCTAssertEqual(command.params, includeExpected)
217-
XCTAssertNil(command.body)
218-
219-
// swiftlint:disable:next line_length
220-
guard let urlExpected = URL(string: "http://localhost:1337/1/users/yarr?include=%5B%22yolo%22,%20%22test%22%5D") else {
221-
XCTFail("Should have unwrapped")
222-
return
223-
}
224-
let request = command.prepareURLRequest(options: [])
225-
switch request {
226-
case .success(let url):
227-
XCTAssertEqual(url.url, urlExpected)
228-
case .failure(let error):
229-
XCTFail(error.localizedDescription)
216+
XCTAssertEqual(command.params?.keys.first, includeExpected.keys.first)
217+
if let value = command.params?.values.first,
218+
let includeValue = value {
219+
XCTAssertTrue(includeValue.contains("\"yolo\""))
220+
} else {
221+
XCTFail("Should have unwrapped value")
230222
}
223+
XCTAssertNil(command.body)
231224
} catch {
232225
XCTFail(error.localizedDescription)
233226
}

0 commit comments

Comments
 (0)