|
17 | 17 | import { ComponentFixture, TestBed } from '@angular/core/testing'; |
18 | 18 | import { Component, input, signal } from '@angular/core'; |
19 | 19 | import { ColumnComponent } from './column.component'; |
| 20 | +import { ComponentModel } from '@a2ui/web_core/v0_9'; |
20 | 21 | import { A2uiRendererService } from '../../core/a2ui-renderer.service'; |
21 | 22 | import { ComponentBinder } from '../../core/component-binder.service'; |
22 | 23 | import { By } from '@angular/platform-browser'; |
@@ -44,9 +45,9 @@ describe('ColumnComponent', () => { |
44 | 45 | beforeEach(async () => { |
45 | 46 | mockSurface = { |
46 | 47 | componentsModel: new Map([ |
47 | | - ['child1', { id: 'child1', type: 'Child', properties: {} }], |
48 | | - ['child2', { id: 'child2', type: 'Child', properties: {} }], |
49 | | - ['template1', { id: 'template1', type: 'Child', properties: {} }], |
| 48 | + ['child1', new ComponentModel('child1', 'Child', {})], |
| 49 | + ['child2', new ComponentModel('child2', 'Child', {})], |
| 50 | + ['template1', new ComponentModel('template1', 'Child', {})], |
50 | 51 | ]), |
51 | 52 | catalog: { |
52 | 53 | id: 'test-catalog', |
@@ -94,10 +95,9 @@ describe('ColumnComponent', () => { |
94 | 95 |
|
95 | 96 | it('should apply flex styles from props', () => { |
96 | 97 | fixture.detectChanges(); |
97 | | - const div = fixture.debugElement.query(By.css('.a2ui-column')); |
98 | | - expect(div.styles['justify-content']).toBe('start'); |
99 | | - expect(div.styles['align-items']).toBe('stretch'); |
100 | | - expect(div.styles['gap']).toBe('4px'); |
| 98 | + const style = window.getComputedStyle(fixture.debugElement.nativeElement); |
| 99 | + expect(style.justifyContent).toBe('flex-start'); |
| 100 | + expect(style.alignItems).toBe('stretch'); |
101 | 101 | }); |
102 | 102 |
|
103 | 103 | it('should render non-repeating children', () => { |
@@ -161,7 +161,7 @@ describe('ColumnComponent', () => { |
161 | 161 | }, |
162 | 162 | }); |
163 | 163 | fixture.detectChanges(); |
164 | | - const div = fixture.debugElement.query(By.css('.a2ui-column')); |
| 164 | + const div = fixture.debugElement; |
165 | 165 | expect(div.styles['justify-content']).toBeFalsy(); |
166 | 166 | expect(div.styles['align-items']).toBeFalsy(); |
167 | 167 | }); |
|
0 commit comments