@@ -39,19 +39,21 @@ describe('pagination', () => {
3939 let testComponent : NzTestPaginationComponent ;
4040 let pagination : DebugElement ;
4141 let paginationElement : HTMLElement ;
42+ let paginationRootElement : HTMLElement ;
4243
4344 beforeEach ( ( ) => {
4445 fixture = TestBed . createComponent ( NzTestPaginationComponent ) ;
4546 testComponent = fixture . debugElement . componentInstance ;
4647 pagination = fixture . debugElement . query ( By . directive ( NzPaginationComponent ) ) ;
4748 fixture . detectChanges ( ) ;
48- paginationElement = pagination . nativeElement ;
49+ paginationRootElement = pagination . nativeElement ;
50+ paginationElement = pagination . nativeElement . querySelector ( 'ul' ) ! ;
4951 } ) ;
5052
5153 describe ( 'not simple mode' , ( ) => {
5254 it ( 'should className correct' , ( ) => {
5355 fixture . detectChanges ( ) ;
54- expect ( paginationElement . classList . contains ( 'ant-pagination' ) ) . toBe ( true ) ;
56+ expect ( paginationRootElement . classList . contains ( 'ant-pagination' ) ) . toBe ( true ) ;
5557 expect ( paginationElement . firstElementChild ! . classList . contains ( 'ant-pagination-prev' ) ) . toBe ( true ) ;
5658 expect ( paginationElement . firstElementChild ! . classList . contains ( 'ant-pagination-disabled' ) ) . toBe ( true ) ;
5759 expect ( paginationElement . lastElementChild ! . classList . contains ( 'ant-pagination-next' ) ) . toBe ( true ) ;
@@ -64,7 +66,7 @@ describe('pagination', () => {
6466 it ( 'should small size className correct' , ( ) => {
6567 testComponent . size = 'small' ;
6668 fixture . detectChanges ( ) ;
67- expect ( paginationElement . classList . contains ( 'mini' ) ) . toBe ( true ) ;
69+ expect ( paginationRootElement . classList . contains ( 'mini' ) ) . toBe ( true ) ;
6870 } ) ;
6971
7072 it ( 'should pageIndex change work' , ( ) => {
@@ -237,18 +239,19 @@ describe('pagination', () => {
237239 fixture . detectChanges ( ) ;
238240 testComponent . disabled = true ;
239241 fixture . detectChanges ( ) ;
240- expect ( paginationElement . classList . contains ( 'ant-pagination-disabled' ) ) . toBe ( true ) ;
242+ expect ( paginationRootElement . classList . contains ( 'ant-pagination-disabled' ) ) . toBe ( true ) ;
241243 } ) ;
242244 } ) ;
243245
244246 describe ( 'simple mode' , ( ) => {
245247 beforeEach ( ( ) => {
246248 testComponent . simple = true ;
247249 fixture . detectChanges ( ) ;
248- paginationElement = pagination . nativeElement ;
250+ paginationRootElement = pagination . nativeElement ;
251+ paginationElement = pagination . nativeElement . querySelector ( 'ul' ) ! ;
249252 } ) ;
250253 it ( 'should simple className work' , ( ) => {
251- expect ( paginationElement . classList . contains ( 'ant-pagination-simple' ) ) . toBe ( true ) ;
254+ expect ( paginationRootElement . classList . contains ( 'ant-pagination-simple' ) ) . toBe ( true ) ;
252255 expect ( paginationElement . firstElementChild ! . classList . contains ( 'ant-pagination-prev' ) ) . toBe ( true ) ;
253256 expect ( paginationElement . lastElementChild ! . classList . contains ( 'ant-pagination-next' ) ) . toBe ( true ) ;
254257 } ) ;
@@ -313,7 +316,7 @@ describe('pagination', () => {
313316 fixture = TestBed . createComponent ( NzTestPaginationRenderComponent ) ;
314317 pagination = fixture . debugElement . query ( By . directive ( NzPaginationComponent ) ) ;
315318 fixture . detectChanges ( ) ;
316- paginationElement = pagination . nativeElement ;
319+ paginationElement = pagination . nativeElement . querySelector ( 'ul' ) ! ;
317320 } ) ;
318321 it ( 'should render correct' , ( ) => {
319322 fixture . detectChanges ( ) ;
@@ -334,7 +337,7 @@ describe('pagination', () => {
334337 testComponent = fixture . debugElement . componentInstance ;
335338 pagination = fixture . debugElement . query ( By . directive ( NzPaginationComponent ) ) ;
336339 fixture . detectChanges ( ) ;
337- paginationElement = pagination . nativeElement ;
340+ paginationElement = pagination . nativeElement . querySelector ( 'ul' ) ! ;
338341 } ) ;
339342
340343 it ( 'should render correct' , ( ) => {
@@ -389,7 +392,7 @@ describe('pagination', () => {
389392 fixture = TestBed . createComponent ( NzTestPaginationRtlComponent ) ;
390393 pagination = fixture . debugElement . query ( By . directive ( NzPaginationComponent ) ) ;
391394 fixture . detectChanges ( ) ;
392- paginationElement = pagination . nativeElement ;
395+ paginationElement = pagination . nativeElement . querySelector ( 'ul' ) ! ;
393396 } ) ;
394397
395398 it ( 'should pagination className correct on dir change' , ( ) => {
0 commit comments