|
| 1 | +import assert from "assert"; |
| 2 | + |
| 3 | + |
| 4 | +/** |
| 5 | + * The tests in this suite are known to fail, due to a bug in the library. If the tests here start |
| 6 | + * failing in the sense of mocha, then the test is passing and you have either: |
| 7 | + * |
| 8 | + * 1) Fixed the bug (yay! remove the test) |
| 9 | + * 2) Triggered some unknown underlying issue (boo! investigate) |
| 10 | + * |
| 11 | + * When adding something here, make sure to link the issue. |
| 12 | + */ |
| 13 | +suite('Known failures', function() { |
| 14 | + function testKnownFailure(message, testFn, only) { |
| 15 | + let runner = only ? test.only : test; |
| 16 | + runner(message, function(done) { |
| 17 | + try { |
| 18 | + testFn(done); |
| 19 | + done(new Error("Expected test fo fail")); |
| 20 | + } catch (e) { |
| 21 | + if (e instanceof assert.AssertionError) { |
| 22 | + this.skip(); |
| 23 | + } else { |
| 24 | + done(e); |
| 25 | + } |
| 26 | + } |
| 27 | + }); |
| 28 | + } |
| 29 | + testKnownFailure.only = function(message, testFn) { |
| 30 | + return testKnownFailure(message, testFn, true); |
| 31 | + }; |
| 32 | + |
| 33 | + // Escaped parameters are not correctly parsed |
| 34 | + // Please see https://github.com/kewisch/ical.js/issues/669 |
| 35 | + testKnownFailure('Parameter escaping', function() { |
| 36 | + let subject = ICAL.Property.fromString(`ATTENDEE;CN="Z\\;":mailto:[email protected]`); |
| 37 | + assert.equal(subject.getParameter("cn"), "Z\\;"); |
| 38 | + assert.equal(subject.getFirstValue(), "mailto:[email protected]"); |
| 39 | + }); |
| 40 | +}); |
0 commit comments