Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
P
planner-team-one
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
21
Issues
21
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Евгений Положенцев
planner-team-one
Commits
d70bebb7
Commit
d70bebb7
authored
Nov 30, 2022
by
Ermolaev Timur
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#79
написал еще тесты
parent
58310411
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
1 deletion
+13
-1
MonthCalendar.test.js
planner-front/src/tests/MonthCalendar.test.js
+13
-1
No files found.
planner-front/src/tests/MonthCalendar.test.js
View file @
d70bebb7
import
{
getDaysInMonth
,
getCurrentMonthString
,
dateToISOLikeButLocal
}
from
'../helpers/CalendarHelpers'
;
import
{
getDaysInMonth
,
getCurrentMonthString
,
dateToISOLikeButLocal
}
from
'../helpers/CalendarHelpers'
;
import
{
taskIsAvailableInCell
}
from
'../components/MonthCalendarBody/CalendarRowDay/Helpers'
import
{
getAvailableTasks
,
getSortedTasks
}
from
'../components/MonthCalendarBody/CalendarRowDay/Helpers'
describe
(
'Получение дней в феврале 2022'
,
()
=>
{
describe
(
'Получение дней в феврале 2022'
,
()
=>
{
test
(
'Всего дней'
,
()
=>
{
test
(
'Всего дней'
,
()
=>
{
...
@@ -54,3 +54,15 @@ describe('Получение ISO даты', () => {
...
@@ -54,3 +54,15 @@ describe('Получение ISO даты', () => {
expect
(
dateToISOLikeButLocal
(
new
Date
(
2021
,
'sd'
,
28
,
5
,
59
))).
toBe
(
null
);
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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment