Skip to content

Commit

Permalink
Merge pull request #909 from nextcloud/fix/add-child-for-schedule-cal…
Browse files Browse the repository at this point in the history
…endar-transparency

fix: add child to schedule-calendar-transp property
  • Loading branch information
miaulalala authored and st3iny committed Jul 17, 2024
2 parents 30618ee + 17b7142 commit dc2471b
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/propset/calendarPropSet.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,9 @@ export default function calendarPropSet(props) {
case '{urn:ietf:params:xml:ns:caldav}schedule-calendar-transp':
xmlified.push({
name: [NS.IETF_CALDAV, 'schedule-calendar-transp'],
value,
children: [{
name: [NS.IETF_CALDAV, value],
}],
})
break
default:
Expand Down
32 changes: 32 additions & 0 deletions test/unit/propset/calendarPropSetTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,4 +118,36 @@ describe('Calendar prop-set', () => {
}
]);
});

it('should serialize {urn:ietf:params:xml:ns:caldav}schedule-calendar-transp correctly - transparent', () => {
expect(calendarPropSet({
'{Foo:}bar': 123,
'{urn:ietf:params:xml:ns:caldav}schedule-calendar-transp': 'transparent'
})).toEqual([
{
name: ['urn:ietf:params:xml:ns:caldav', 'schedule-calendar-transp'],
children: [
{
name: ['urn:ietf:params:xml:ns:caldav', 'transparent'],
},
],
}
]);
});

it('should serialize {urn:ietf:params:xml:ns:caldav}schedule-calendar-transp correctly - opaque', () => {
expect(calendarPropSet({
'{Foo:}bar': 123,
'{urn:ietf:params:xml:ns:caldav}schedule-calendar-transp': 'opaque'
})).toEqual([
{
name: ['urn:ietf:params:xml:ns:caldav', 'schedule-calendar-transp'],
children: [
{
name: ['urn:ietf:params:xml:ns:caldav', 'opaque'],
},
],
}
]);
});
});

0 comments on commit dc2471b

Please sign in to comment.