Browse Source

revert test

pull/6660/head
IhorKaleniuk666 2 months ago
parent
commit
d56ba64cad
  1. 4
      packages/core/src/dom_components/model/Component.ts
  2. 15
      packages/core/test/specs/data_sources/model/data_collection/ComponentDataCollection.ts

4
packages/core/src/dom_components/model/Component.ts

@ -1670,11 +1670,9 @@ export default class Component extends StyleableModel<ComponentProperties> {
}
}
// ★ Добавляем "реальный" component id,
// если он отличается от attributes.id
const attrs = this.get('attributes') || {};
if (this.ccid && attrs.id && this.ccid !== attrs.id) {
(obj as any).id = this.ccid;
obj.id = this.ccid;
}
if (this.em.getConfig().avoidDefaults) {

15
packages/core/test/specs/data_sources/model/data_collection/ComponentDataCollection.ts

@ -105,15 +105,12 @@ describe('Collection component', () => {
expect(cmp.toHTML()).toBe(`<${tagName} id="${cmp.getId()}">${innerHTML}</${tagName}>`);
expect(cmp.getEl()?.innerHTML).toBe(innerHTML);
const json = JSON.parse(JSON.stringify(cmp.toJSON()));
expect(json).toEqual(
expect.objectContaining({
tagName,
dataResolver: cmp.get('dataResolver'),
type: cmp.getType(),
attributes: cmp.getAttributes(),
}),
);
expect(JSON.parse(JSON.stringify(cmp.toJSON()))).toEqual({
tagName: cmp.tagName,
dataResolver: cmp.get('dataResolver'),
type: cmp.getType(),
attributes: cmp.getAttributes(),
});
};
const checkRecordsWithInnerCmp = () => {

Loading…
Cancel
Save