@@ -3,6 +3,7 @@ import { MockComponents } from 'ng-mocks';
33import { SortEvent } from 'primeng/api' ;
44import { TablePageEvent } from 'primeng/table' ;
55
6+ import { TemplateRef } from '@angular/core' ;
67import { ComponentFixture , TestBed } from '@angular/core/testing' ;
78
89import { SortOrder } from '@osf/shared/enums/sort-order.enum' ;
@@ -87,17 +88,14 @@ describe('MyProjectsTableComponent', () => {
8788 expect ( component . sortOrder ( ) ) . toBe ( SortOrder . Desc ) ;
8889 } ) ;
8990
90- it ( 'should default isLoading and showDownloadColumn to false' , ( ) => {
91+ it ( 'should default isLoading to false' , ( ) => {
9192 expect ( component . isLoading ( ) ) . toBe ( false ) ;
92- expect ( component . showDownloadColumn ( ) ) . toBe ( false ) ;
9393 } ) ;
9494
95- it ( 'should accept isLoading and showDownloadColumn inputs ' , ( ) => {
95+ it ( 'should accept isLoading input ' , ( ) => {
9696 fixture . componentRef . setInput ( 'isLoading' , true ) ;
97- fixture . componentRef . setInput ( 'showDownloadColumn' , true ) ;
9897
9998 expect ( component . isLoading ( ) ) . toBe ( true ) ;
100- expect ( component . showDownloadColumn ( ) ) . toBe ( true ) ;
10199 } ) ;
102100
103101 it ( 'should default emptyMessageKey to common.search.noResultsFound' , ( ) => {
@@ -118,8 +116,8 @@ describe('MyProjectsTableComponent', () => {
118116 expect ( component . columnCount ( ) ) . toBe ( 3 ) ;
119117 } ) ;
120118
121- it ( 'should return columnCount of 4 when download column is shown ' , ( ) => {
122- fixture . componentRef . setInput ( 'showDownloadColumn ' , true ) ;
119+ it ( 'should return columnCount of 4 when downloadCellTemplate is provided ' , ( ) => {
120+ fixture . componentRef . setInput ( 'downloadCellTemplate ' , { } as TemplateRef < { $implicit : MyResourcesItem } > ) ;
123121
124122 expect ( component . columnCount ( ) ) . toBe ( 4 ) ;
125123 } ) ;
0 commit comments