Browse Source

Update tests for symbols with override

pull/3428/head
Artur Arseniev 5 years ago
parent
commit
210f87030d
  1. 31
      test/specs/dom_components/model/Symbols.js

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

@ -488,6 +488,37 @@ describe('Symbols', () => {
expect(cmp.components().length).toBe(innCompsLen)
);
});
test('On symbol components update, those having override are ignored', () => {
comp.set(keySymbolOvrd, ['components']);
const innCompsLen = comp.components().length;
// Check reset action
symbol.components('Test text');
all.forEach(cmp => {
expect(cmp.components().length).toBe(cmp === comp ? innCompsLen : 1);
});
// Align comp with others
comp.components('Test text');
all.forEach(cmp => expect(cmp.components().length).toBe(1));
// Check add action
symbol.append('<div>A</div>');
all.forEach(cmp => {
expect(cmp.components().length).toBe(cmp === comp ? 1 : 2);
});
// Align comp with others
comp.append('<div>A</div>');
all.forEach(cmp => expect(cmp.components().length).toBe(2));
// Check remove action
symbol
.components()
.at(0)
.remove();
all.forEach(cmp => {
expect(cmp.components().length).toBe(cmp === comp ? 2 : 1);
});
});
});
});

Loading…
Cancel
Save