!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/@buffetjs/core/src/components/TimePicker/tests/   drwxr-xr-x
Free 13.23 GB of 57.97 GB (22.83%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


Viewing file:     index.test.js (2.88 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
import React from 'react';
import { mount } from 'enzyme';

import { TimePicker as StyledTimePicker } from '@buffetjs/styles';
import TimePicker, { timeFormatter } from '../index';

const defaultProps = { name: 'time' };
const renderComponent = (props = defaultProps) =>
  mount(<TimePicker {...props} />);

describe('<TimePicker />', () => {
  describe('Parser onBlur', () => {
    it('Should format the value to 10:38:00 if 10:38 is given', () => {
      expect(timeFormatter('10:38')).toEqual('10:38:00');
    });

    it('Should format the value to 10:38:00 if 10h38 is given', () => {
      expect(timeFormatter('10h38')).toEqual('10:38:00');
    });

    it('Should format the value to 10:38:00 if 10H38 is given', () => {
      expect(timeFormatter('10H38')).toEqual('10:38:00');
    });

    it('Should format the value to 10:00:00 if 10: is given', () => {
      expect(timeFormatter('10:')).toEqual('10:00:00');
    });

    it('Should format the value to 10:00:00 if 10 is given', () => {
      expect(timeFormatter('10')).toEqual('10:00:00');
    });

    it('Should format the value to 10:38:38 if 10:38:38 is given', () => {
      expect(timeFormatter('10:38:38')).toEqual('10:38:38');
    });

    it('Should format the value to 01:11:00 if 1:11:00 is given', () => {
      expect(timeFormatter('1:11:00')).toEqual('01:11:00');
    });

    it('Should format the value to 01:10:00 if 11:1:00 is given', () => {
      expect(timeFormatter('11:1:00')).toEqual('11:10:00');
    });

    it('Should format the value to 11:10:2 if 11:10:20 is given', () => {
      expect(timeFormatter('11:10:2')).toEqual('11:10:20');
    });

    it('Should format the value to 1200 if 12:00:00 is given', () => {
      expect(timeFormatter('1200')).toEqual('12:00:00');
    });

    it('Should format the value to 111 if 01:11:00 is given', () => {
      expect(timeFormatter('111')).toEqual('01:11:00');
    });

    it('Should format the value to 00:00:00 if null is given', () => {
      expect(timeFormatter(null)).toEqual('00:00:00');
    });

    it('Should format the value to 00:00:00 if nothing is given', () => {
      expect(timeFormatter('')).toEqual('00:00:00');
    });
  });

  describe('<TimePicker /> behavior', () => {
    // eslint-disable-next-line jest/expect-expect
    it('should not crash', () => {
      renderComponent();
    });

    it('should send a formatted string onChange', () => {
      const onChange = jest.fn();
      const value = '';
      const renderedComponent = renderComponent({
        ...defaultProps,
        onChange,
        value,
      });

      const element = renderedComponent.find(StyledTimePicker);
      const mock = { target: { value: '10' } };
      element.simulate('change', mock);

      const expected = {
        target: {
          name: 'time',
          type: 'time',
          value: '10:00:00',
        },
      };
      expect(onChange).toHaveBeenCalledWith(expected);
    });
  });
});

:: 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.007 ]--