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

Fixed failing unit test - ember/object get function was removed from source code so I have changed unit test accordingly #2345

Merged
merged 1 commit into from
Dec 3, 2021

Conversation

candunaj
Copy link
Contributor

@candunaj candunaj commented Dec 2, 2021

Issue

I have fixed a unit test which was failing quietly

Explanation

"get" function was used for getting tokenAttribute and identificationAttribute. So there could be used path to property like "employee.token"

const tokenAttribute = get(data, tokenAttributeName);
const identificationAttribute = get(data, identificationAttributeName);

it was changed 5 years ago with PR #957

_data[tokenAttributeName]
_data[identificationAttributeName]

After that change, only the property name could be used in tokenAttributeName. There was tokenAttributeName: 'employee.token' used in one test. So that test was failing. It was failing quietly because there was "throw undefined" which mocha does not catch.
I have fixed that test by using resourceName:'employee' and tokenAttributeName:'token' as required by code change.

authenticator = Devise.extend({ tokenAttributeName: 'employee.token', identificationAttributeName: 'employee.email' }).create();
authenticator = Devise.extend({ resourceName: 'employee', tokenAttributeName: 'token', identificationAttributeName: 'email' }).create();

@marcoow
Copy link
Member

marcoow commented Dec 2, 2021

I don't understand how title and description of the PR relate to the changes tbh…

Copy link
Member

@marcoow marcoow left a comment

Choose a reason for hiding this comment

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

Can you update the title though so it actually describes what this PR does?

@candunaj candunaj changed the title In the test was throw undefined which was not caught with mocha. Fixed failing unit test - ember/object get function was removed from source code so I have changed unit test accordingly Dec 2, 2021
@marcoow marcoow merged commit 61c8da5 into master Dec 3, 2021
@delete-merged-branch delete-merged-branch bot deleted the test-failing-quietly branch December 3, 2021 09:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants