This repository was archived by the owner on Jun 1, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +19
-2
lines changed
src/app/modules/angular-slickgrid/components/__tests__ Expand file tree Collapse file tree 2 files changed +19
-2
lines changed Original file line number Diff line number Diff line change @@ -156,6 +156,21 @@ describe('App Component', () => {
156156 expect ( component . totalItems ) . toBe ( 100 ) ;
157157 } ) ;
158158
159+ it ( 'should create a the Slick-Pagination component in the DOM and expect different locale when changed' , ( ) => {
160+ translate . use ( 'en' ) ;
161+ fixture . detectChanges ( ) ;
162+
163+ const elm = document . querySelector ( '.slick-pagination' ) ;
164+ const pageInfoFromTo = fixture . debugElement . query ( By . css ( '.page-info-from-to' ) ) . nativeElement ;
165+ const pageInfoTotalItems = fixture . debugElement . query ( By . css ( '.page-info-total-items' ) ) . nativeElement ;
166+
167+ expect ( translate . currentLang ) . toBe ( 'en' ) ;
168+ expect ( elm . innerHTML ) . toContain ( 'slick-pagination-nav' ) ;
169+ expect ( pageInfoFromTo . innerHTML ) . toBe ( '<span data-test="item-from">5</span>-<span data-test="item-to">10</span> of ' ) ;
170+ expect ( pageInfoTotalItems . innerHTML ) . toBe ( '<span data-test="total-items">100</span> items ' ) ;
171+ expect ( component . totalItems ) . toBe ( 100 ) ;
172+ } ) ;
173+
159174 it ( 'should call changeToFirstPage() from the View and expect the pagination service to be called with correct method' , fakeAsync ( ( ) => {
160175 const spy = jest . spyOn ( paginationServiceStub , 'goToFirstPage' ) ;
161176
Original file line number Diff line number Diff line change @@ -49,7 +49,8 @@ describe('Example 5 - OData Grid', () => {
4949 it ( 'should change Pagination to first page with 10 items' , ( ) => {
5050 cy . get ( '#items-per-page-label' ) . select ( '10' ) ;
5151
52- // wait for the query to finish
52+ // wait for the query to start and finish
53+ cy . get ( '[data-test=status]' ) . should ( 'contain' , 'processing...' ) ;
5354 cy . get ( '[data-test=status]' ) . should ( 'contain' , 'done' ) ;
5455
5556 cy . get ( '[data-test=page-number-input]' )
@@ -301,7 +302,8 @@ describe('Example 5 - OData Grid', () => {
301302 it ( 'should change Pagination to first page with 10 items' , ( ) => {
302303 cy . get ( '#items-per-page-label' ) . select ( '10' ) ;
303304
304- // wait for the query to finish
305+ // wait for the query to start and finish
306+ cy . get ( '[data-test=status]' ) . should ( 'contain' , 'processing...' ) ;
305307 cy . get ( '[data-test=status]' ) . should ( 'contain' , 'done' ) ;
306308
307309 cy . get ( '[data-test=odata-query-result]' )
You can’t perform that action at this time.
0 commit comments