Commit d70bebb7 authored by Ermolaev Timur's avatar Ermolaev Timur

#79 написал еще тесты

parent 58310411
import {getDaysInMonth, getCurrentMonthString, dateToISOLikeButLocal} from '../helpers/CalendarHelpers';
import {taskIsAvailableInCell} from '../components/MonthCalendarBody/CalendarRowDay/Helpers'
import {getAvailableTasks, getSortedTasks} from '../components/MonthCalendarBody/CalendarRowDay/Helpers'
describe('Получение дней в феврале 2022', () => {
test('Всего дней', () => {
......@@ -54,3 +54,15 @@ describe('Получение ISO даты', () => {
expect(dateToISOLikeButLocal(new Date(2021, 'sd', 28, 5, 59))).toBe(null);
})
})
describe('Получение допустимых задач для клетки', () => {
test('Валидные задачи', () => {
expect(getAvailableTasks([{infoForCell: {startYear: 2022, startMonth: 12, startDay: 12}}, {infoForCell: {startYear: 2022, startMonth: 12, startDay: 12}}], 2022, 11, 12).length).toBe(2);
})
test('Не валидные задачи', () => {
expect(getAvailableTasks([{infoForCell: {startYear: 2021, startMonth: 11, startDay: 12}}, {infoForCell: {startYear: 2022, startMonth: 12, startDay: 14}}], 2022, 11, 12).length).toBe(0);
})
test('Не все прошедшие проверку задачи', () => {
expect(getAvailableTasks([{infoForCell: {startYear: 2021, startMonth: 11, startDay: 12}}, {infoForCell: {startYear: 2022, startMonth: 12, startDay: 12}}], 2022, 11, 12).length).toBe(1);
})
})
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment