From b40d92f41ddd2dfcbedf4ea8abab883ad8c96b1a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82?= <720354+jembezmamy@users.noreply.github.com> Date: Wed, 14 Dec 2022 16:59:22 +0100 Subject: [PATCH] failing test --- tests/integration/model-test.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) 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',