adopted-ember-addons / adopted-ember-addons/ember-data-model-fragments
Fragment changed inflight is not returning as dirty
- Ngôn ngữ chính
- TypeScript
- Star
- 367
- Fork
- 108
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Mô tả
In a recent update to Ember 3.8 I updated this addon and an existing test (last updated 2 years ago) began failing.
While saving, the record is updated and after the save finalizes the record claims to not have any dirty attributes.
```
test('String Array - changed and then changed back while inflight', function(assert) {
let record = this.testRecord;
// Sanity check the default values
assert.notOk(record.get('hasDirtyAttributes'), 'Record should start out clean');
assert.deepEqual(record.get('tags').toArray(), ['Kroger', 'Target', 'Meijer'], 'Should start out with the proper tags.');
// Sanity check for saving and dirtyness
Ember.run(function() { record.get('tags').addObject('Remke'); });
assert.deepEqual(record.get('tags').toArray(), ['Kroger', 'Target', 'Meijer', 'Remke'], 'Should have been updated.');
assert.ok(record.get('hasDirtyAttributes'), 'Record now be dirty');
Ember.run(() => { record.save(); });
Ember.run(() => { record.get('tags').removeObject('Remke'); });
Ember.run(() => { this.resumeSave(); });
Ember.run(() => {
// This is where hasDirtyAttributes is coming back false
assert.ok(record.get('hasDirtyAttributes'), 'Record should still be dirty because it was change back in flight');
assert.deepEqual(record.get('tags').toArray(), ['Kroger', 'Target', 'Meijer'], 'Should have been updated.');
});
});
```
Hướng dẫn đóng góp
Đánh giá
Issue này chưa được đánh giá.