!C99Shell v. 2.5 [PHP 8 Update] [24.05.2025]!

Software: Apache/2.4.41 (Ubuntu). PHP/8.0.30 

uname -a: Linux apirnd 5.4.0-204-generic #224-Ubuntu SMP Thu Dec 5 13:38:28 UTC 2024 x86_64 

uid=33(www-data) gid=33(www-data) groups=33(www-data) 

Safe-mode: OFF (not secure)

/var/www/html/wincloud_gateway/node_modules/reactstrap/src/__tests__/   drwxr-xr-x
Free 12.92 GB of 57.97 GB (22.29%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


Viewing file:     UncontrolledCarousel.spec.js (5.29 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
import React from 'react';
import { shallow } from 'enzyme';
import { Carousel, UncontrolledCarousel } from '../';

const items = [
  { src: '', altText: 'a', caption: 'caption 1', key: '1' },
  { src: '', altText: 'b', caption: 'caption 2', key: '2' },
  { src: '', altText: 'c', caption: 'caption 3', key: '3' }
];

describe('UncontrolledCarousel', () => {
  it('should be an Carousel', () => {
    const carousel = shallow(<UncontrolledCarousel items={items} />);
    expect(carousel.type()).toBe(Carousel);
  });

  it('should have activeIndex default to 0', () => {
    const carousel = shallow(<UncontrolledCarousel items={items} />);
    expect(carousel.prop('activeIndex')).toBe(0);
  });

  it('should have next function', () => {
    const carousel = shallow(<UncontrolledCarousel items={items} />);
    expect(carousel.prop('next')).toEqual(expect.any(Function));
  });

  it('should have prev function', () => {
    const carousel = shallow(<UncontrolledCarousel items={items} />);
    expect(carousel.prop('previous')).toEqual(expect.any(Function));
  });

  it('should have ride set to "carousel" by default', () => {
    const carousel = shallow(<UncontrolledCarousel items={items} />);
    expect(carousel.prop('ride')).toBe('carousel');
  });

  it('should have ride set to undefined when autoPlay is false', () => {
    const carousel = shallow(<UncontrolledCarousel items={items} autoPlay={false} />);
    expect(carousel.prop('ride')).toBe(undefined);
  });

  it('should have ride set to "carousel" when autoPlay is true', () => {
    const carousel = shallow(<UncontrolledCarousel items={items} autoPlay />);
    expect(carousel.prop('ride')).toBe('carousel');
  });

  it('should increase the activeIndex when next is called', () => {
    const carousel = shallow(<UncontrolledCarousel items={items} />);
    const instance = carousel.instance();
    instance.next();
    carousel.update();
    expect(carousel.prop('activeIndex')).toBe(1);
  });

  it('should not increase the activeIndex when next is called while animating', () => {
    const carousel = shallow(<UncontrolledCarousel items={items} />);
    const instance = carousel.instance();
    instance.animating = true;
    instance.next();
    expect(carousel.prop('activeIndex')).toBe(0);
  });

  it('should wrap the activeIndex when next is called on the last item', () => {
    const carousel = shallow(<UncontrolledCarousel items={items} />);
    const instance = carousel.instance();
    instance.next();
    carousel.update();
    expect(carousel.prop('activeIndex')).toBe(1);
    instance.next();
    carousel.update();
    expect(carousel.prop('activeIndex')).toBe(2);
    instance.next();
    carousel.update();
    expect(carousel.prop('activeIndex')).toBe(0);
    instance.next();
    carousel.update();
    expect(carousel.prop('activeIndex')).toBe(1);
  });

  it('should decrease the activeIndex when previous is called', () => {
    const carousel = shallow(<UncontrolledCarousel items={items} />);
    const instance = carousel.instance();
    instance.next();
    carousel.update();
    expect(carousel.prop('activeIndex')).toBe(1);
    instance.previous();
    carousel.update();
    expect(carousel.prop('activeIndex')).toBe(0);
  });

  it('should not decrease the activeIndex when previous is called while animating', () => {
    const carousel = shallow(<UncontrolledCarousel items={items} />);
    const instance = carousel.instance();
    instance.next();
    carousel.update();
    expect(carousel.prop('activeIndex')).toBe(1);
    instance.animating = true;
    instance.previous();
    carousel.update();
    expect(carousel.prop('activeIndex')).toBe(1);
  });

  it('should wrap the activeIndex when previous is called on the first item', () => {
    const carousel = shallow(<UncontrolledCarousel items={items} />);
    const instance = carousel.instance();
    instance.previous();
    carousel.update();
    expect(carousel.prop('activeIndex')).toBe(2);
  });

  it('should set the activeIndex when goToIndex is called with a value', () => {
    const carousel = shallow(<UncontrolledCarousel items={items} />);
    const instance = carousel.instance();
    instance.goToIndex(2);
    carousel.update();
    expect(carousel.prop('activeIndex')).toBe(2);
  });

  it('should not set the activeIndex when goToIndex is called with a value when animating', () => {
    const carousel = shallow(<UncontrolledCarousel items={items} />);
    const instance = carousel.instance();
    instance.animating = true;
    instance.goToIndex(2);
    carousel.update();
    expect(carousel.prop('activeIndex')).toBe(0);
  });

  it('should track animating of the slides', () => {
    const carousel = shallow(<UncontrolledCarousel items={items} />);
    const instance = carousel.instance();
    expect(instance.animating).toBe(false);
    instance.onExiting();
    expect(instance.animating).toBe(true);
    instance.onExited();
    expect(instance.animating).toBe(false);
  });

  it('should render carousel items with provided key', () => {
    const carousel = shallow(<UncontrolledCarousel items={items} indicators={false} />);
    const carouselItem1 = carousel.childAt(0);
    const carouselItem2 = carousel.childAt(1);
    const carouselItem3 = carousel.childAt(2);
    expect(carouselItem1.key()).toBe('1');
    expect(carouselItem2.key()).toBe('2');
    expect(carouselItem3.key()).toBe('3');
  });
});

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

:: Make Dir ::
 
[ Read-Only ]
:: Make File ::
 
[ Read-Only ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0044 ]--