Browse Source

Update __isSymbolTop

br-test
Artur Arseniev 5 years ago
parent
commit
d474f7f442
  1. 4
      src/dom_components/model/Component.js
  2. 2
      test/specs/dom_components/model/Symbols.js

4
src/dom_components/model/Component.js

@ -621,8 +621,10 @@ const Component = Backbone.Model.extend(Styleable).extend(
__isSymbolTop() {
const parent = this.parent();
const symb = this.__isSymbol() || this.__getSymbol();
return (
!parent || (parent && !parent.__isSymbol() && !parent.__getSymbol())
symb &&
(!parent || (parent && !parent.__isSymbol() && !parent.__getSymbol()))
);
},

2
test/specs/dom_components/model/Symbols.js

@ -43,6 +43,8 @@ describe('Symbols', () => {
wrapper.components().reset();
});
// TODO check that clone itself doesn't create symbols
test('Create symbol from a component', () => {
const comp = wrapper.append(simpleComp)[0];
const symbol = createSymbol(comp);

Loading…
Cancel
Save