l-lin / angular-datatables

DataTables with Angular
https://l-lin.github.io/angular-datatables/
MIT License
1.57k stars 486 forks source link

ci: add ci for demo #1591

Closed l-lin closed 3 years ago

l-lin commented 3 years ago

Unit tests were added for the demo folder. We shall add a CI for future example's unit tests.

shanmukhateja commented 3 years ago

@l-lin thanks for the PR. I see npm run test still fails. Let me see if I can fix this.

l-lin commented 3 years ago

@shanmukhateja, tests fail on using-ng-template-ref.component.spec.ts.

I think it's because the demo is initializing the dtOptions on ngAfterViewInit instead of ngOnInit. Moreover, there is a setTimeout used in the demo, so we may need to use fakeAsync in the spec.

shanmukhateja commented 3 years ago

@l-lin can confirm. Upgrading the lib to v12 on the demo project triggers the same errors you've seen.

fakeAsync is interesting. I'll check it out.

Thanks :)

l-lin commented 3 years ago

@shanmukhateja, I refactor a bit the angular-datatables.directive.ts and using-ng-template-ref.component.ts. It seems we won't need to use the fakeAsync :)