Skip to content
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

Push Activation State Machine missing tests #720

Merged
merged 15 commits into from
Jul 13, 2018

Conversation

ricardopereira
Copy link
Contributor

No description provided.

@ricardopereira ricardopereira requested a review from funkyboy April 27, 2018 17:28
@ricardopereira ricardopereira changed the base branch from push-device-auth-tests to push May 4, 2018 11:02
Copy link
Contributor

@funkyboy funkyboy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good. I left a couple of minor comments.

// RSH3g
context("State WaitingForDeregistration") {
// RSH3f
context("State AfterRegistrationUpdateFailed") {

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extra whitespace


let deviceIdentityToken = stateMachine.rest.device.identityTokenDetails?.token.base64Encoded()

let simulatedError = NSError(domain: ARTAblyErrorDomain, code: 1234, userInfo: nil)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is repeated quite often. I suggest to have a createError() helper function.

}
}
stateMachine.send(ARTPushActivationEventCalledActivate())
expect(stateMachine.current).to(beAKindOf(ARTPushActivationStateWaitingForRegistrationUpdate.self))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is repeated below on line 876

stateMachine.send(ARTPushActivationEventDeregistrationFailed(error: expectedError))
expect(stateMachine.current).to(beAKindOf(ARTPushActivationStateWaitingForDeregistration.self))
expect(deactivatedCallbackCalled).to(beTrue())
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is missing a test for RSH3g3b

}

// RSH5
it("event handling sould be atomic and sequential") {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo "should"

@funkyboy funkyboy force-pushed the push-activation-state-machine-missing-tests branch from 7163969 to ca29f73 Compare July 12, 2018 15:38
@funkyboy
Copy link
Contributor

Rebased on push branch now.

@funkyboy
Copy link
Contributor

Failing tests https://travis-ci.org/ably/ably-ios/builds/403176500 have already been fixed in this PR #708

@funkyboy funkyboy merged this pull request into push Jul 13, 2018
@funkyboy funkyboy deleted the push-activation-state-machine-missing-tests branch July 13, 2018 14:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants