Browse Source

Format

data-source-import-policy
Artur Arseniev 6 months ago
parent
commit
a05c11d0b1
  1. 57
      packages/core/test/specs/data_sources/dataBindingImportPolicy.ts

57
packages/core/test/specs/data_sources/dataBindingImportPolicy.ts

@ -184,17 +184,14 @@ describe('Data source import policy', () => {
expect(component.getStyle({ skipResolve: true }).color).toBe('green'); expect(component.getStyle({ skipResolve: true }).color).toBe('green');
expectUntouchedComponentValues(component); expectUntouchedComponentValues(component);
dsm dsm.get('records').getRecord('rec1')?.set({
.get('records') tagName: 'article',
.getRecord('rec1') title: 'Changed Title',
?.set({ color: 'purple',
tagName: 'article', keepProp: 'Changed Keep Prop',
title: 'Changed Title', keepAttr: 'Changed Keep Attr',
color: 'purple', borderColor: 'yellow',
keepProp: 'Changed Keep Prop', });
keepAttr: 'Changed Keep Attr',
borderColor: 'yellow',
});
expect(component.get('tagName')).toBe('section'); expect(component.get('tagName')).toBe('section');
expect(component.getAttributes()['data-attr']).toBe('Imported Title'); expect(component.getAttributes()['data-attr']).toBe('Imported Title');
@ -224,17 +221,14 @@ describe('Data source import policy', () => {
expect(dsm.getValue('records.rec1.title')).toBe('Initial Title'); expect(dsm.getValue('records.rec1.title')).toBe('Initial Title');
expect(dsm.getValue('records.rec1.color')).toBe('red'); expect(dsm.getValue('records.rec1.color')).toBe('red');
dsm dsm.get('records').getRecord('rec1')?.set({
.get('records') tagName: 'article',
.getRecord('rec1') title: 'Changed Title',
?.set({ color: 'purple',
tagName: 'article', keepProp: 'Changed Keep Prop',
title: 'Changed Title', keepAttr: 'Changed Keep Attr',
color: 'purple', borderColor: 'yellow',
keepProp: 'Changed Keep Prop', });
keepAttr: 'Changed Keep Attr',
borderColor: 'yellow',
});
expect(component.get('tagName')).toBe('article'); expect(component.get('tagName')).toBe('article');
expect(component.getAttributes()['data-attr']).toBe('Changed Title'); expect(component.getAttributes()['data-attr']).toBe('Changed Title');
@ -264,17 +258,14 @@ describe('Data source import policy', () => {
expect(component.getStyle({ skipResolve: true }).color).toEqual(makeColorVar()); expect(component.getStyle({ skipResolve: true }).color).toEqual(makeColorVar());
expectUntouchedComponentValues(component); expectUntouchedComponentValues(component);
dsm dsm.get('records').getRecord('rec1')?.set({
.get('records') tagName: 'article',
.getRecord('rec1') title: 'Changed Again',
?.set({ color: 'orange',
tagName: 'article', keepProp: 'Changed Keep Prop',
title: 'Changed Again', keepAttr: 'Changed Keep Attr',
color: 'orange', borderColor: 'yellow',
keepProp: 'Changed Keep Prop', });
keepAttr: 'Changed Keep Attr',
borderColor: 'yellow',
});
expect(component.get('tagName')).toBe('article'); expect(component.get('tagName')).toBe('article');
expect(component.getAttributes()['data-attr']).toBe('Changed Again'); expect(component.getAttributes()['data-attr']).toBe('Changed Again');

Loading…
Cancel
Save