Fixing conditional when trying to determine the court slot start times
This commit is contained in:
parent
d21eb747b1
commit
c5978a8289
2 changed files with 6 additions and 2 deletions
|
|
@ -794,7 +794,7 @@ export class BaanReserverenService {
|
||||||
public getCourtSlotsForDate(date: Dayjs) {
|
public getCourtSlotsForDate(date: Dayjs) {
|
||||||
const time = date.format('HH:mm')
|
const time = date.format('HH:mm')
|
||||||
const weekdayEndSelector =
|
const weekdayEndSelector =
|
||||||
date.day() !== 0 || date.day() !== 6 ? 'weekday' : 'weekend'
|
date.day() !== 0 && date.day() !== 6 ? 'weekday' : 'weekend'
|
||||||
for (const [timeClass, timesForWeekdayAndWeekend] of Object.entries(
|
for (const [timeClass, timesForWeekdayAndWeekend] of Object.entries(
|
||||||
StartTimeClassStartTimes,
|
StartTimeClassStartTimes,
|
||||||
)) {
|
)) {
|
||||||
|
|
|
||||||
|
|
@ -138,7 +138,7 @@ describe('baanreserveren.service', () => {
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
|
||||||
describe.only('getCourtSlotsForDate', () => {
|
describe('getCourtSlotsForDate', () => {
|
||||||
it.each([
|
it.each([
|
||||||
{
|
{
|
||||||
date: '2025-04-10T16:30:00.000Z',
|
date: '2025-04-10T16:30:00.000Z',
|
||||||
|
|
@ -164,6 +164,10 @@ describe('baanreserveren.service', () => {
|
||||||
date: '2025-01-10T18:00:00.000Z',
|
date: '2025-01-10T18:00:00.000Z',
|
||||||
expectedCourtSlots: StartTimeClassCourtSlots[StartTimeClass.Second],
|
expectedCourtSlots: StartTimeClassCourtSlots[StartTimeClass.Second],
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
date: '2026-07-26T08:30:00.000Z',
|
||||||
|
expectedCourtSlots: StartTimeClassCourtSlots[StartTimeClass.First],
|
||||||
|
},
|
||||||
])(
|
])(
|
||||||
'should get correct court slots for $date',
|
'should get correct court slots for $date',
|
||||||
({ date, expectedCourtSlots }) => {
|
({ date, expectedCourtSlots }) => {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue