diff --git a/tests/integration/model-test.ts b/tests/integration/model-test.ts index f021ea2..cdd3d65 100644 --- a/tests/integration/model-test.ts +++ b/tests/integration/model-test.ts @@ -369,6 +369,22 @@ module('Integration - Model', function (hooks) { assert.strictEqual(record.name, 'Jupiter2'); }); + test('update cached attribute after rebase', async function (assert) { + const recordBase = cache.addRecord({ + type: 'planet', + name: 'Jupiter' + }); + const fork = cache.fork(); + const record = fork.findRecord(recordBase.type, recordBase.id); + + assert.strictEqual(record.name, 'Jupiter'); + + recordBase?.$replaceAttribute('name', 'Jupiter2'); + fork.rebase(); + + assert.strictEqual(record.name, 'Jupiter2'); + }); + test('update via store: replaceAttribute operation invalidates attribute on model', async function (assert) { const record = await store.addRecord({ type: 'planet',