Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
it('should change arrow direction when document direction changes', () => {
const menuItems = [{ title: '', children: [{ title: '' }] }];
const { fixture } = createSingleMenuComponent(menuItems);
const iconComponent = fixture.debugElement.query(By.directive(NbIconComponent)) as DebugElement;
const directionService: NbLayoutDirectionService = TestBed.get(NbLayoutDirectionService);
expect(iconComponent.componentInstance.icon).toEqual('chevron-left-outline');
directionService.setDirection(NbLayoutDirection.RTL);
fixture.detectChanges();
expect(iconComponent.componentInstance.icon).toEqual('chevron-right-outline');
});
toggleFlow() {
const oppositeDirection = this.isRtl
? NbLayoutDirection.LTR
: NbLayoutDirection.RTL;
this.directionService.setDirection(oppositeDirection);
}
}