Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 11f6614a authored by Philip Whitehouse's avatar Philip Whitehouse
Browse files

Expand link testing to cover HTTP, HTTPS and Mailto

parent 7ae0c34b
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -217,6 +217,9 @@ public class HtmlSanitizerTest {
    @Test
    public void shouldKeepUris() {
        String html = "<html><body>" +
                "<a href=\"http://example.com/index.html\">HTTP</a>" +
                "<a href=\"https://example.com/default.html\">HTTPS</a>" +
                "<a href=\"mailto:user@example.com\">Mailto</a>" +
                "<a href=\"tel:00442079460111\">Telephone</a>" +
                "<a href=\"sip:user@example.com\">SIP</a>" +
                "<a href=\"bitcoin:12A1MyfXbW6RhdRAZEqofac5jCQQjwEPBu\">Bitcoin</a>" +
@@ -227,6 +230,9 @@ public class HtmlSanitizerTest {
        Document result = htmlSanitizer.sanitize(html);

        assertEquals("<html><head></head><body>" +
                "<a href=\"http://example.com/index.html\">HTTP</a>" +
                "<a href=\"https://example.com/default.html\">HTTPS</a>" +
                "<a href=\"mailto:user@example.com\">Mailto</a>" +
                "<a href=\"tel:00442079460111\">Telephone</a>" +
                "<a href=\"sip:user@example.com\">SIP</a>" +
                "<a href=\"bitcoin:12A1MyfXbW6RhdRAZEqofac5jCQQjwEPBu\">Bitcoin</a>" +