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

revert is-empty flag change, leave todo #5540

Merged
merged 2 commits into from
Jul 26, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion addon/-legacy-private/system/model/states.js
Original file line number Diff line number Diff line change
Expand Up @@ -521,7 +521,6 @@ const RootState = {
loading: {
// FLAGS
isLoading: true,
isEmpty: true,

exit(internalModel) {
internalModel._promiseProxy = null;
Expand Down
1 change: 0 additions & 1 deletion addon/-record-data-private/system/model/states.js
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,6 @@ const RootState = {
// XHR to retrieve the data.
loading: {
// FLAGS
isEmpty: true,
isLoading: true,

exit(internalModel) {
Expand Down
2 changes: 1 addition & 1 deletion tests/helpers/todo.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export default function todo(description, callback) {
let todos = [];
hijackAssert(assert, todos);

await callback(assert);
await callback.call(this, assert);

assertTestStatus(assert, todos);
});
Expand Down
9 changes: 6 additions & 3 deletions tests/integration/records/load-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import JSONAPIAdapter from 'ember-data/adapters/json-api';
import JSONAPISerializer from 'ember-data/serializers/json-api';
import { attr, belongsTo } from '@ember-decorators/data';
import { run } from '@ember/runloop';
import todo from '../../helpers/todo';

class Person extends Model {
@attr name;
Expand Down Expand Up @@ -40,7 +41,9 @@ module('integration/load - Loading Records', function(hooks) {
});
});

test('Empty records remain in the empty state while data is being fetched', async function(assert) {
todo('Empty records remain in the empty state while data is being fetched', async function(
assert
) {
let payloads = [
{
data: {
Expand Down Expand Up @@ -125,7 +128,7 @@ module('integration/load - Loading Records', function(hooks) {
let recordPromise = store.findRecord('person', '1');

// test that during the initial load our state is correct
assert.equal(
assert.todo.equal(
internalModel.isEmpty(),
true,
'awaiting first fetch: We remain in the empty state'
Expand Down Expand Up @@ -180,7 +183,7 @@ module('integration/load - Loading Records', function(hooks) {

// test that during a reload-due-to-unload our state is correct
// This requires a retainer (the async bestFriend relationship)
assert.equal(internalModel.isEmpty(), true, 'awaiting second find: We remain empty');
assert.todo.equal(internalModel.isEmpty(), true, 'awaiting second find: We remain empty');
assert.equal(internalModel.isLoading(), true, 'awaiting second find: We are loading again');
assert.equal(internalModel.isReloading, false, 'awaiting second find: We are not reloading');

Expand Down