-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move back to debouncing background refresh
- Loading branch information
Lee Richmond
committed
Feb 24, 2016
1 parent
6343eb2
commit 2fa1cfc
Showing
7 changed files
with
56 additions
and
18 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
import { Factory } from 'ember-cli-mirage'; | ||
import { Factory, faker } from 'ember-cli-mirage'; | ||
|
||
export default Factory.extend({ | ||
name() { return Faker.name.firstName() } | ||
name() { return faker.name.firstName() } | ||
}); |
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,32 @@ | ||
import { test } from 'qunit'; | ||
import moduleForAcceptance from '../../tests/helpers/module-for-acceptance'; | ||
import page from '../pages/people-search'; | ||
|
||
moduleForAcceptance('Acceptance | background refresh', { | ||
beforeEach() { | ||
server.create('person'); | ||
server.omitDefaultConditions = true; | ||
} | ||
}); | ||
|
||
test('triggering background refresh', function(assert) { | ||
page.visit(); | ||
|
||
andThen(function() { | ||
assert.equal(page.results().count(), 1, 'show have correct initial results'); | ||
server.create('person'); | ||
server.timing = 100; | ||
page.triggerBackgroundRefresh(); | ||
|
||
let done = assert.async(); | ||
setTimeout(() => { | ||
assert.notOk(page.isLoading(), 'should not show loading indicator'); | ||
done(); | ||
}, 80); | ||
|
||
andThen(function() { | ||
assert.equal(page.results().count(), 2, 'show update the search results'); | ||
server.timing = 0; | ||
}); | ||
}); | ||
}); |
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