-
Notifications
You must be signed in to change notification settings - Fork 605
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
Problems using Ephemeral storage during testing #132
Comments
Can you provide a backtrace? Also you should just run the normal |
So I followed your recommendation and set store in Ember.SimpleAuth.setup in https://github.com/digitalplaywright/eak-simple-auth/blob/testing-experiment/app/initializers/auth.js
The error above went away, but there an error is still remaining so I can't know if it is a full fix before that one is fixed. The other error is triggered in https://github.com/digitalplaywright/eak-simple-auth/blob/testing-experiment/tests/helpers/signin.js on
I am getting another error 'TypeError: Cannot call method 'authenticate' of undefined' with the stack trace (does not look that useful):
This is starting to look like a user error on my part, but the lookup above on session works in developer mode in the browser so any tips you have on how to fix this is very helpful. Am I missing a dependency in testing? Should this lookup not work in testing? |
That means that nothing is registered for |
As far as I know I am registering the same in testing as production, because I am using the same initializers. However, maybe there is a problem in the way I call authenticate to begin with. Is there a recommended way to authenticate through a method call in testing? What I am doing in https://github.com/digitalplaywright/eak-simple-auth/blob/testing-experiment/tests/helpers/signin.js is not very pretty
|
The recommended way would be to trigger your route action with valid credentials (e.g. |
Do you know of an example showing how to do this? I know of several developers that are having trouble with this particular aspect so I don't know where to get help and I am yet to bridge the gap to a working example test using mocking with ember simple auth. |
Have a look at this for example: https://github.com/ugisozols/ember-simple-auth-rails-demo/blob/master/test/javascripts/integration/login_test.js. When you stub the server response and wrap that in a test helper you probably have what you are looking for. I'm closing this as it doesn't seem to be an issues with Ember.SimpleAuth. Please ask further questions on stack overflow.com so this is only used for issues. |
I submitted a question on the subject here: There was no ember-simple-auth tag so I am not sure how to notify you of this question other than commenting here. |
As recommended I am trying to use the Ephemeral storage during testing to make sure that there is no conflict between a non-testing and testing session, and to mock API calls. However, I get this error:
when setEphemeralSessionStore is called on https://github.com/digitalplaywright/eak-simple-auth/blob/testing-experiment/tests/acceptance/login-test.js#L6
where setEphemeralSessionStore is defined in https://github.com/digitalplaywright/eak-simple-auth/blob/testing-experiment/tests/helpers/signin.js#L17
Can you see if there is a bug or if I am doing something wrong?
The text was updated successfully, but these errors were encountered: