Blame view

天文台pc/tianwentai-ui/node_modules/react-day-picker/src/contexts/DayPicker/labels/labelWeekday.test.ts 415 Bytes
bc518174   王天杨   提交两个项目文件
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
  import { es } from 'date-fns/locale';
  
  import { labelWeekday } from './labelWeekday';
  
  const weekDay = new Date(2022, 10, 21);
  
  test('should return the formatted weekday name', () => {
    expect(labelWeekday(weekDay)).toEqual('Monday');
  });
  
  describe('when a locale is passed in', () => {
    test('should format using the locale', () => {
      expect(labelWeekday(weekDay, { locale: es })).toEqual('lunes');
    });
  });