From 0f3f71c38c2db67ce538ad20ae0acf0a1268d026 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Thu, 28 Jan 2021 08:49:41 +0100 Subject: [PATCH] Add test for cloning components inside the main symbol --- test/specs/dom_components/model/Symbols.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/test/specs/dom_components/model/Symbols.js b/test/specs/dom_components/model/Symbols.js index da5ea6032..cb5ce891b 100644 --- a/test/specs/dom_components/model/Symbols.js +++ b/test/specs/dom_components/model/Symbols.js @@ -270,5 +270,18 @@ describe('Symbols', () => { const innerSymb = allInst.map(i => getInnerComp(i, 1)); expect(clonedSymb.__getSymbols()).toEqual(innerSymb); }); + + test('Cloning a component in a symbol, reflects changes to all instances', () => { + const clonedSymb = duplicate(getInnerComp(symbol)); + const cloned = getInnerComp(comp, 1); + const newLen = symbol.components().length; + // As above + expect(newLen).toBe(compInitChild + 1); + expect(cloned.__getSymbol()).toBe(clonedSymb); + all.forEach(cmp => expect(cmp.components().length).toBe(newLen)); + allInst.forEach(cmp => expect(getInnSymbol(cmp, 1)).toBe(clonedSymb)); + const innerSymb = allInst.map(i => getInnerComp(i, 1)); + expect(clonedSymb.__getSymbols()).toEqual(innerSymb); + }); }); });