-
Notifications
You must be signed in to change notification settings - Fork 78
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
Write tests for services/project user #1489
Conversation
b57fecf
to
b17d7a9
Compare
app/services/project-user.js
Outdated
.save() | ||
.then(() => this._flashSuccess('Your request has been sent.')) | ||
.catch(() => this._flashError('Your request hasn not been sent.')); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing },
to close the function.
app/services/project-user.js
Outdated
|
||
_flashError(message) { | ||
let options = { fixed: true, sticky: false, timeout: 5000 }; | ||
get(this, 'flashMessages').clearMessages().danger(message, options); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing }
to close the function.
}); | ||
|
||
test('it sends an error flash message if joinProject fails', function(assert) { | ||
let service = this.subject(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The test
function on line 14 is not closed, and the test
on line 54 is not indented correctly.
Your last commits are both named |
service.joinProject(project).then(() => { | ||
done(); | ||
}); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test
function is still not closed by a });
which means you're running right into the next test
inside this test
(which itself is not left indented correctly).
7b7ac7c
to
6116285
Compare
2179d5b
to
da188ff
Compare
… to include error message when projectJoin fails added flashOptions object to clear up code
da188ff
to
3244660
Compare
What's in this PR?
Two tests for project-user component.
joinProject creates a new projectUser with properties {project, currentUser, role: 'pending'}
joinProject creates a flash notification on success
Fixes #1182