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

Write tests for services/project user #1489

Merged
merged 1 commit into from
Nov 9, 2017

Conversation

daveconnis
Copy link
Contributor

@daveconnis daveconnis commented Nov 7, 2017

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

@joshsmith joshsmith force-pushed the write-tests-for-services/project-user branch from b57fecf to b17d7a9 Compare November 7, 2017 19:47
.save()
.then(() => this._flashSuccess('Your request has been sent.'))
.catch(() => this._flashError('Your request hasn not been sent.'));

Copy link
Contributor

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.


_flashError(message) {
let options = { fixed: true, sticky: false, timeout: 5000 };
get(this, 'flashMessages').clearMessages().danger(message, options);
});
Copy link
Contributor

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();
Copy link
Contributor

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.

@joshsmith
Copy link
Contributor

Your last commits are both named --amend. I'm guessing you were trying to amend your commit but instead committed with the message of "--amend".

service.joinProject(project).then(() => {
done();
});

Copy link
Contributor

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).

@daveconnis daveconnis force-pushed the write-tests-for-services/project-user branch from 7b7ac7c to 6116285 Compare November 8, 2017 17:56
@daveconnis daveconnis force-pushed the write-tests-for-services/project-user branch from 2179d5b to da188ff Compare November 9, 2017 16:50
… to include error message when projectJoin fails

added flashOptions object to clear up code
@joshsmith joshsmith force-pushed the write-tests-for-services/project-user branch from da188ff to 3244660 Compare November 9, 2017 17:11
@joshsmith joshsmith merged commit a51ee2a into develop Nov 9, 2017
@joshsmith joshsmith deleted the write-tests-for-services/project-user branch November 9, 2017 17:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants