Browse Source

Add test for cloning components inside the main symbol

pull/3264/head
Artur Arseniev 5 years ago
parent
commit
0f3f71c38c
  1. 13
      test/specs/dom_components/model/Symbols.js

13
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);
});
});
});

Loading…
Cancel
Save