-
Notifications
You must be signed in to change notification settings - Fork 39
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
[EOSF-594] Add example controller unit tests and component integration tests #293
Merged
Merged
Changes from all commits
Commits
Show all changes
33 commits
Select commit
Hold shift + click to select a range
8f10f47
add facotry-guy, mockjax and acceptance test
7728d4c
Fix module for acceptance, play with content test some more
06f1d3f
Flesh out content controller tests
adbdbff
New component tests:
7313017
Adjust author-link tests
4f2d582
Merge branch 'develop' of http:/CenterForOpenScience/embe…
cd2947f
Clean up tests and remove unused code
227b7ba
Make sure bower has Faker
2091748
Update yarn with pinned ember-osf commit
hmoco ddaa0c9
Merge branch 'feature/tests' of http:/CenterForOpenScienc…
ed8659f
Update packages, add stubbing to requests in acceptance tests
eea027d
Merge branch 'develop' of http:/CenterForOpenScience/embe…
0aa4bbd
Merge branch 'feature/tests' of http:/CenterForOpenScienc…
514e5b6
Remove obsolete tests
93b096d
Update module-for-acceptance.js
hmoco 41e49eb
skip do nothing test, start discover page setup
7b2f3b1
unsure on how to ensure data is available fully prior to hitting andThen
781ed81
Make separates and joins of copyright providers use ', ' rather than ','
6a20fbd
Play around some more with acceptance/runs
6bfd5c8
remove unused tests (acceptance) and clean up/separate other tests
bc75a16
Merge branch 'develop' of http:/CenterForOpenScience/embe…
hmoco 669d71a
Merge branch 'feature/tests' of http:/CenterForOpenScienc…
hmoco 480c3d6
Attempt to recreate yarn file
hmoco d4e63d3
Attempt to fix lockfile conflicts
hmoco a399056
Merge branch 'feature/tests' of http:/CenterForOpenScienc…
hmoco 80c272c
Clean up packages, pin ember data facotry guy version
hmoco bc0e632
Merge branch 'develop' of http:/CenterForOpenScience/embe…
hmoco c12ce72
Add messages to test failures
hmoco a751d6e
Make split and joins consistent across copyrightHolders and test for it
hmoco c6bb595
Distinguish async behavior on discardbasics, test for copyright holde…
hmoco 28208e4
Revert changes made to submit conroller made in c6bb5953137687cd2cd0b…
jamescdavis ef7d697
Merge branch 'develop' of http:/CenterForOpenScience/embe…
hmoco 842875d
Move filedownloadUrl test to its component
hmoco File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import Ember from 'ember'; | ||
import { moduleForComponent, test } from 'ember-qunit'; | ||
import hbs from 'htmlbars-inline-precompile'; | ||
import FactoryGuy, { manualSetup } from 'ember-data-factory-guy'; | ||
|
||
moduleForComponent('author-link', 'Integration | Component | author link', { | ||
integration: true, | ||
beforeEach: function() { | ||
manualSetup(this.container); | ||
} | ||
}); | ||
|
||
test('renders non-links', function(assert) { | ||
let contributorModel = FactoryGuy.make('contributor'); | ||
// Problem here is that author link expects a share search-result contributor, | ||
// not a store instance of a contributor and its user(s). | ||
let contributor = {users: {identifiers: []}}; | ||
contributor.users.name = contributorModel.get('users.fullName'); | ||
contributor = Ember.merge(contributor, contributorModel.serialize().data.attributes); | ||
this.set('contributor', contributor); | ||
this.render(hbs`{{author-link contributor=contributor}}`); | ||
assert.ok(!this.$('a').length, 'Found a link when user has no identifiers'); | ||
assert.equal(this.$().text().trim(), contributorModel.get('users.fullName'), 'Text of author-link not equal to fullName of user'); | ||
}); | ||
|
||
test('renders links', function(assert) { | ||
let contributorModel = FactoryGuy.make('contributor'); | ||
let contributor = {users: {identifiers: []}}; | ||
contributor.users.name = contributorModel.get('users.fullName'); | ||
contributor = Ember.merge(contributor, contributorModel.serialize().data.attributes); | ||
contributor.users.identifiers.push('https://staging.osf.io/cool'); | ||
this.set('contributor', contributor); | ||
|
||
this.render(hbs`{{author-link contributor=contributor}}`); | ||
assert.ok(this.$('a').length, 'Expected a link in author-link as user has an identifier'); | ||
assert.equal(this.$().text().trim(), contributorModel.get('users.fullName'), 'Text of author-link not equal to fullName of user'); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Need to add a test for this.