1 import withVeventRruleWkst
from '../../../lib/calendar/recurrence/rruleWkst';
3 describe('rrule wkst', () => {
4 it('should apply a wkst if it is relevant (weekly)', () => {
8 value
: { year
: 2019, month
: 7, day
: 19, hours
: 12, minutes
: 0, seconds
: 0, isUTC
: false },
9 parameters
: { tzid
: 'America/New_York' },
22 const newVevent
= withVeventRruleWkst(vevent
, 0);
23 expect(newVevent
).toEqual({
26 value
: { year
: 2019, month
: 7, day
: 19, hours
: 12, minutes
: 0, seconds
: 0, isUTC
: false },
27 parameters
: { tzid
: 'America/New_York' },
43 it('should apply a wkst if it is relevant (yearly)', () => {
53 const newVevent
= withVeventRruleWkst(vevent
, 0);
54 expect(newVevent
).toEqual({
66 it('should not apply a wkst if it is the default value', () => {
77 const newVevent
= withVeventRruleWkst(vevent
, 1);
78 expect(newVevent
.rrule
.value
).toEqual({
85 it('should not apply a wkst if it is not needed', () => {
95 const newVevent
= withVeventRruleWkst(vevent
, 0);
96 expect(newVevent
.rrule
.value
.wkst
).toBeUndefined();
99 it('should not apply a wkst if it is not needed #2', () => {
108 const newVevent
= withVeventRruleWkst(vevent
, 0);
109 expect(newVevent
.rrule
.value
.wkst
).toBeUndefined();
112 it('should remove wkst if it is not relevant', () => {
124 const newVevent
= withVeventRruleWkst(vevent
, 1);
125 expect(newVevent
.rrule
.value
).toEqual({