From 2762b0ad831f7567fc0be815fa68028854e5346c Mon Sep 17 00:00:00 2001 From: Laffery <49607541+Laffery@users.noreply.github.com> Date: Fri, 8 Nov 2024 07:56:00 +0800 Subject: [PATCH] test(module:carousel): remove invalid cases (#8860) --- components/carousel/carousel.spec.ts | 47 +--------------------------- 1 file changed, 1 insertion(+), 46 deletions(-) diff --git a/components/carousel/carousel.spec.ts b/components/carousel/carousel.spec.ts index 78be2ab6519..a65546345e9 100644 --- a/components/carousel/carousel.spec.ts +++ b/components/carousel/carousel.spec.ts @@ -1,4 +1,4 @@ -import { BidiModule, Dir, Direction, Directionality } from '@angular/cdk/bidi'; +import { Directionality } from '@angular/cdk/bidi'; import { ENTER, LEFT_ARROW, RIGHT_ARROW } from '@angular/cdk/keycodes'; import { Component, DebugElement, ViewChild } from '@angular/core'; import { ComponentFixture, discardPeriodicTasks, fakeAsync, TestBed, tick } from '@angular/core/testing'; @@ -476,20 +476,6 @@ export class NzTestCarouselBasicComponent { beforeChange = jasmine.createSpy('beforeChange callback'); } -@Component({ - standalone: true, - imports: [BidiModule, NzTestCarouselBasicComponent], - template: ` -
- -
- ` -}) -export class NzTestCarouselRtlComponent { - @ViewChild(Dir) dir!: Dir; - direction: Direction = 'rtl'; -} - @Component({ standalone: true, imports: [NzCarouselModule], @@ -531,7 +517,6 @@ describe('carousel', () => { }); TestBed.configureTestingModule({ - imports: [NzCarouselModule], providers: [ { provide: Directionality, @@ -592,34 +577,4 @@ describe('carousel', () => { tick(101); expect(component.layout).toHaveBeenCalled(); })); - - it('should set correct index as active in ltr mode', () => { - component.dir = 'ltr'; - component.carouselContents = [ - { - isActive: false - }, - { - isActive: false - } - ] as NzSafeAny; - component['markContentActive'](0); - - expect((component.carouselContents as NzSafeAny)[0].isActive).toBeTruthy(); - }); - - it('should set correct index as active in rtl mode', () => { - component.dir = 'rtl'; - component.carouselContents = [ - { - isActive: false - }, - { - isActive: false - } - ] as NzSafeAny; - component['markContentActive'](0); - - expect((component.carouselContents as NzSafeAny)[1].isActive).toBeTruthy(); - }); });