Skip to content

Failing tests for Email Verification Resend #240

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions Tests/ParseSwiftTests/ParseObjectTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -634,6 +634,13 @@ class ParseObjectTests: XCTestCase { // swiftlint:disable:this type_body_length
return MockURLResponse(data: encoded, statusCode: 200, delay: 0.0)
}
do {
score.score = 12
let command = try score.saveCommand()
XCTAssertNotNil(command)
XCTAssertEqual(command.path.urlComponent, "/classes/GameScore/yarr")
XCTAssertEqual(command.method, API.Method.PUT)
XCTAssertNil(command.body?.player)
XCTAssertEqual(command.body?.score, 12)
let saved = try score.save()
guard let savedUpdatedAt = saved.updatedAt else {
XCTFail("Should unwrap dates")
Expand Down
46 changes: 46 additions & 0 deletions Tests/ParseSwiftTests/ParseUserTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -777,6 +777,52 @@ class ParseUserTests: XCTestCase { // swiftlint:disable:this type_body_length
XCTAssertEqual(command.body?.customKey, "hello")
}

func testSignupCommandAndFutureSave() throws {
var loginResponse = LoginSignupResponse()
loginResponse.email = nil

MockURLProtocol.mockRequests { _ in
do {
let encoded = try loginResponse.getEncoder().encode(loginResponse, skipKeys: .none)
return MockURLResponse(data: encoded, statusCode: 200, delay: 0.0)
} catch {
return nil
}
}
do {
var user = User()
user.username = loginUserName
user.password = loginPassword
user.email = "[email protected]"
user.customKey = "blah"
let signedUp = try user.signup()
XCTAssertNotNil(signedUp)
XCTAssertNotNil(signedUp.createdAt)
XCTAssertNotNil(signedUp.updatedAt)
XCTAssertEqual(signedUp.email, "[email protected]")
XCTAssertNotNil(signedUp.username)
XCTAssertNil(signedUp.password)
XCTAssertNotNil(signedUp.objectId)
XCTAssertNotNil(signedUp.sessionToken)
XCTAssertNotNil(signedUp.customKey)
XCTAssertNil(signedUp.ACL)

var current = User.current
current?.customKey = "blah2"
let command = try current?.saveCommand()
XCTAssertNotNil(command)
XCTAssertEqual(command?.path.urlComponent, "/users/yarr")
XCTAssertEqual(command?.method, API.Method.PUT)
XCTAssertNil(command?.body?.email)
XCTAssertNil(command?.body?.username)
XCTAssertNil(command?.body?.password)
XCTAssertEqual(command?.body?.customKey, "blah2")

} catch {
XCTFail(error.localizedDescription)
}
}

func testUserSignUp() {
let loginResponse = LoginSignupResponse()

Expand Down