-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #47 from embermap/load-v2
New load and sideload methods to align with ember-data APIs
- Loading branch information
Showing
31 changed files
with
4,525 additions
and
2,847 deletions.
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
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 |
---|---|---|
@@ -1,32 +1,31 @@ | ||
import { module, test } from 'qunit'; | ||
import { visit, click, find } from '@ember/test-helpers'; | ||
import { setupApplicationTest } from 'ember-qunit'; | ||
import { startMirage } from 'dummy/initializers/ember-cli-mirage'; | ||
import startMirage from 'dummy/tests/helpers/start-mirage'; | ||
|
||
module('Acceptance | load relationship', function(hooks) { | ||
let server; | ||
|
||
setupApplicationTest(hooks); | ||
startMirage(hooks); | ||
|
||
hooks.beforeEach(function() { | ||
server = startMirage(); | ||
}); | ||
test('the load demo works', async function(assert) { | ||
await visit('/docs/guides/working-with-relationships'); | ||
|
||
hooks.afterEach(function() { | ||
server.shutdown(); | ||
}); | ||
await click('[data-test-id=load-comments]'); | ||
|
||
test('visiting /load-relationship', async function(assert) { | ||
let post = server.create('post', { id: '1', title: 'Post 1 title' }); | ||
server.createList('comment', 3, { post }); | ||
assert.equal( | ||
find('[data-test-id=load-comments-count]').textContent.trim(), | ||
"The post has 3 comments." | ||
); | ||
}); | ||
|
||
test('the reloadWith demo works', async function(assert) { | ||
await visit('/docs/guides/working-with-relationships'); | ||
|
||
await click('[data-test-id=load-comments]'); | ||
await click('[data-test-id=reload-with-comments]'); | ||
|
||
assert.equal( | ||
find('[data-test-id=comments-count]').textContent.trim(), | ||
"The post has 3 comments." | ||
find('[data-test-id=reload-with-comments-count]').textContent.trim(), | ||
"The post has 5 comments." | ||
); | ||
}); | ||
}); |
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.