Skip to content

Commit

Permalink
test(module:carousel): remove invalid cases (#8860)
Browse files Browse the repository at this point in the history
  • Loading branch information
Laffery authored Nov 7, 2024
1 parent cc52555 commit 2762b0a
Showing 1 changed file with 1 addition and 46 deletions.
47 changes: 1 addition & 46 deletions components/carousel/carousel.spec.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -476,20 +476,6 @@ export class NzTestCarouselBasicComponent {
beforeChange = jasmine.createSpy('beforeChange callback');
}

@Component({
standalone: true,
imports: [BidiModule, NzTestCarouselBasicComponent],
template: `
<div [dir]="direction">
<nz-test-carousel></nz-test-carousel>
</div>
`
})
export class NzTestCarouselRtlComponent {
@ViewChild(Dir) dir!: Dir;
direction: Direction = 'rtl';
}

@Component({
standalone: true,
imports: [NzCarouselModule],
Expand Down Expand Up @@ -531,7 +517,6 @@ describe('carousel', () => {
});

TestBed.configureTestingModule({
imports: [NzCarouselModule],
providers: [
{
provide: Directionality,
Expand Down Expand Up @@ -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();
});
});

0 comments on commit 2762b0a

Please sign in to comment.