Skip to content

Commit

Permalink
Add unit test to confirm that subscribe == '1' suppresses title years
Browse files Browse the repository at this point in the history
  • Loading branch information
mjradwin committed Nov 8, 2021
1 parent 4a92255 commit c05e3e8
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 3 deletions.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@hebcal/icalendar",
"version": "4.14.4",
"version": "4.14.5",
"author": "Michael J. Radwin (https://github.com/mjradwin)",
"keywords": [
"ical",
Expand All @@ -24,8 +24,8 @@
"url": "https://github.com/hebcal/hebcal-icalendar/issues"
},
"dependencies": {
"@hebcal/core": "^3.27.0",
"@hebcal/rest-api": "^3.8.6"
"@hebcal/core": "^3.29.1",
"@hebcal/rest-api": "^3.9.0"
},
"scripts": {
"build": "rollup -c",
Expand Down
21 changes: 21 additions & 0 deletions src/icalendar.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,27 @@ test('eventsToIcalendar', async (t) => {
t.deepEqual(lines, expected);
});

test('subscribe-suppress-title-years', async (t) => {
const options = {
year: 2026,
month: 2,
sedrot: true,
candlelighting: true,
location: Location.lookup('Hawaii'),
};
const events = HebrewCalendar.calendar(options);
options.prodid = 'X';
options.subscribe = '1';
const ical = await eventsToIcalendar(events, options);
const lines = ical.split('\r\n');
t.is(findLine(lines, 'X-WR-CALNAME'), 'Hebcal Hawaii');

options.subscribe = false;
const ical2 = await eventsToIcalendar(events, options);
const lines2 = ical2.split('\r\n');
t.is(findLine(lines2, 'X-WR-CALNAME'), 'Hebcal Hawaii February 2026');
});

test('eventsToIcalendar-no-vtimezone', async (t) => {
const options = {
year: 2020,
Expand Down

0 comments on commit c05e3e8

Please sign in to comment.