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

Commit 126e298b authored by Ricki Hirner's avatar Ricki Hirner
Browse files

Add test for DAV:owner with plain text

parent b8eae30a
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -6,7 +6,7 @@ import org.junit.Test
class CalendarDescriptionTest: PropertyTest() {

    @Test
    fun testSource() {
    fun testCalendarDescription() {
        val results = parseProperty("<calendar-description xmlns=\"urn:ietf:params:xml:ns:caldav\">My Calendar</calendar-description>")
        val result = results.first() as CalendarDescription
        assertEquals("My Calendar", result.description)
+9 −2
Original line number Diff line number Diff line
@@ -7,14 +7,21 @@ import org.junit.Test
class OwnerTest: PropertyTest() {

    @Test
    fun testOwner_WithoutHref() {
    fun testOwner_PlainText() {
        val results = parseProperty("<owner xmlns=\"DAV:\">https://example.com</owner>")
        val owner = results.first() as Owner
        assertNull(owner.href)
    }

    @Test
    fun testOwner_OneHref() {
    fun testOwner_PlainTextAndHref() {
        val results = parseProperty("<owner xmlns=\"DAV:\">Principal Name. <href>mailto:owner@example.com</href> (test)</owner>")
        val owner = results.first() as Owner
        assertEquals("mailto:owner@example.com", owner.href)
    }

    @Test
    fun testOwner_Href() {
        val results = parseProperty("<owner xmlns=\"DAV:\"><href>https://example.com</href></owner>")
        val owner = results.first() as Owner
        assertEquals("https://example.com", owner.href)