Skip to content

Commit

Permalink
feat(angular-table): skip test for custom component
Browse files Browse the repository at this point in the history
  • Loading branch information
merto20 committed May 30, 2024
1 parent 250cf3d commit 9f3b59e
Showing 1 changed file with 29 additions and 29 deletions.
58 changes: 29 additions & 29 deletions packages/angular-table/src/__tests__/flex-render.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,36 +115,36 @@ describe('FlexRenderDirective', () => {
expect(fixture.nativeElement.textContent).toEqual('Updated value')
})

// Commented for now, test framework (using ComponentRef.setInput) cannot recognize signal inputs
// Skipq for now, test framework (using ComponentRef.setInput) cannot recognize signal inputs
// as component inputs
// test('should render custom components', () => {
// @Component({
// template: `{{ row().property }}`,
// standalone: true,
// })
// class FakeComponent {
// row = input.required<{ property: string }>()
// }

// const fixture = TestBed.createComponent(TestRenderComponent)
// setFixtureSignalInputs(fixture, {
// content: () => FakeComponent,
// context: {
// row: {
// property: 'Row value',
// },
// },
// })

// expect(fixture.nativeElement.textContent).toEqual('Row value')

// setFixtureSignalInput(fixture, 'context', {
// row: { property: 'Updated value' },
// })
// fixture.detectChanges()

// expect(fixture.nativeElement.textContent).toEqual('Updated value')
// })
it.skip('should render custom components', () => {
@Component({
template: `{{ row().property }}`,
standalone: true,
})
class FakeComponent {
row = input.required<{ property: string }>()
}

const fixture = TestBed.createComponent(TestRenderComponent)
setFixtureSignalInputs(fixture, {
content: () => FakeComponent,
context: {
row: {
property: 'Row value',
},
},
})

expect(fixture.nativeElement.textContent).toEqual('Row value')

setFixtureSignalInput(fixture, 'context', {
row: { property: 'Updated value' },
})
fixture.detectChanges()

expect(fixture.nativeElement.textContent).toEqual('Updated value')
})
})

@Component({
Expand Down

0 comments on commit 9f3b59e

Please sign in to comment.