summaryrefslogtreecommitdiff
path: root/writerperfect
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2017-09-26 11:07:13 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2017-09-26 19:03:13 +0200
commitd81e6184f691cf49abdbf3b3714c507dcca3a50c (patch)
tree29c685e11c1ae1591930282abd8bc9938ea3026d /writerperfect
parentc0c311a12b2a196e23f7fcfbaa2134754e2f74bd (diff)
EPUB export: test link handling
Fails without commit 9480ff6a2b6057410940ff5c40828d5746898a0e (EPUB export: implement link support, 2017-08-17). Change-Id: Icee6ac04ff77d0e9ff66ca1f925d6973b4b342a2 Reviewed-on: https://gerrit.libreoffice.org/42786 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Diffstat (limited to 'writerperfect')
-rw-r--r--writerperfect/qa/unit/EPUBExportTest.cxx11
-rw-r--r--writerperfect/qa/unit/data/writer/epubexport/link.fodt8
2 files changed, 19 insertions, 0 deletions
diff --git a/writerperfect/qa/unit/EPUBExportTest.cxx b/writerperfect/qa/unit/EPUBExportTest.cxx
index 5b3f4b9a0c27..d79a196c7863 100644
--- a/writerperfect/qa/unit/EPUBExportTest.cxx
+++ b/writerperfect/qa/unit/EPUBExportTest.cxx
@@ -71,6 +71,7 @@ public:
void testList();
void testImage();
void testTable();
+ void testLink();
CPPUNIT_TEST_SUITE(EPUBExportTest);
CPPUNIT_TEST(testOutlineLevel);
@@ -91,6 +92,7 @@ public:
CPPUNIT_TEST(testList);
CPPUNIT_TEST(testImage);
CPPUNIT_TEST(testTable);
+ CPPUNIT_TEST(testLink);
CPPUNIT_TEST_SUITE_END();
};
@@ -453,6 +455,15 @@ void EPUBExportTest::testTable()
assertXPath(mpXmlDoc, "//xhtml:table/xhtml:tbody/xhtml:tr/xhtml:td", 4);
}
+void EPUBExportTest::testLink()
+{
+ createDoc("link.fodt", {});
+
+ mpXmlDoc = parseExport("OEBPS/sections/section0001.xhtml");
+ assertXPathContent(mpXmlDoc, "//xhtml:p/xhtml:a", "https://libreoffice.org/");
+ assertXPath(mpXmlDoc, "//xhtml:p/xhtml:a", "href", "https://libreoffice.org/");
+}
+
CPPUNIT_TEST_SUITE_REGISTRATION(EPUBExportTest);
}
diff --git a/writerperfect/qa/unit/data/writer/epubexport/link.fodt b/writerperfect/qa/unit/data/writer/epubexport/link.fodt
new file mode 100644
index 000000000000..9a2efcc0b7a8
--- /dev/null
+++ b/writerperfect/qa/unit/data/writer/epubexport/link.fodt
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<office:document xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" xmlns:xlink="http://www.w3.org/1999/xlink" office:version="1.2" office:mimetype="application/vnd.oasis.opendocument.text">
+ <office:body>
+ <office:text>
+ <text:p>Before <text:a xlink:type="simple" xlink:href="https://libreoffice.org/">https://libreoffice.org/</text:a> after.</text:p>
+ </office:text>
+ </office:body>
+</office:document>