mirror of
https://github.com/nfonteyne/octane-website.git
synced 2026-09-03 23:24:48 +02:00
update: work with webcal
This commit is contained in:
parent
5dce6eb89b
commit
fd81b74594
4 changed files with 40 additions and 3 deletions
20
test/icsUrl.test.js
Normal file
20
test/icsUrl.test.js
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
const { test } = require('node:test');
|
||||
const assert = require('node:assert/strict');
|
||||
const { normalizeIcsUrl } = require('../src/lib/icsUrl');
|
||||
|
||||
test('normalizeIcsUrl: rewrites webcal:// to https://', () => {
|
||||
assert.equal(normalizeIcsUrl('webcal://p01-caldav.icloud.com/foo.ics'), 'https://p01-caldav.icloud.com/foo.ics');
|
||||
});
|
||||
|
||||
test('normalizeIcsUrl: rewrites webcals:// to https://', () => {
|
||||
assert.equal(normalizeIcsUrl('webcals://p01-caldav.icloud.com/foo.ics'), 'https://p01-caldav.icloud.com/foo.ics');
|
||||
});
|
||||
|
||||
test('normalizeIcsUrl: is case-insensitive on the scheme', () => {
|
||||
assert.equal(normalizeIcsUrl('WebCal://example.com/foo.ics'), 'https://example.com/foo.ics');
|
||||
});
|
||||
|
||||
test('normalizeIcsUrl: leaves http/https URLs untouched', () => {
|
||||
assert.equal(normalizeIcsUrl('https://example.com/foo.ics'), 'https://example.com/foo.ics');
|
||||
assert.equal(normalizeIcsUrl('http://example.com/foo.ics'), 'http://example.com/foo.ics');
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue