You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by ra...@apache.org on 2021/01/22 08:49:51 UTC
[sling-org-apache-sling-scripting-sightly-testing] branch master
updated: SLING-9983 - Add support for predefined date format styles
This is an automated email from the ASF dual-hosted git repository.
radu pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-scripting-sightly-testing.git
The following commit(s) were added to refs/heads/master by this push:
new 284cca7 SLING-9983 - Add support for predefined date format styles
284cca7 is described below
commit 284cca73f204293241f6591cce143080dba6d362
Author: Konrad Windszus <kw...@apache.org>
AuthorDate: Fri Jan 22 09:49:45 2021 +0100
SLING-9983 - Add support for predefined date format styles
* added IT
---
.../sling/scripting/sightly/it/SlingSpecificsSightlyIT.java | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/src/test/java/org/apache/sling/scripting/sightly/it/SlingSpecificsSightlyIT.java b/src/test/java/org/apache/sling/scripting/sightly/it/SlingSpecificsSightlyIT.java
index 2eab0ce..fd687c6 100644
--- a/src/test/java/org/apache/sling/scripting/sightly/it/SlingSpecificsSightlyIT.java
+++ b/src/test/java/org/apache/sling/scripting/sightly/it/SlingSpecificsSightlyIT.java
@@ -61,6 +61,7 @@ public class SlingSpecificsSightlyIT {
private static final String SLING_CRLF_NOPKG = SLING_CRLF + ".nopkg.html";
private static final String SLING_CRLF_PKG = SLING_CRLF + ".pkg.html";
private static final String SLING_CRLF_WRONGPKG = SLING_CRLF + ".wrongpkg.html";
+ private static final String SLING_FORMAT = "/content/sightly/format.html";
private static final String SLING_SCRIPT_UPDATE = "/content/sightly/update.html";
private static final String SLING_REQUEST_ATTRIBUTES = "/content/sightly/requestattributes.html";
private static final String SLING_REQUEST_ATTRIBUTES_INCLUDE = "/content/sightly/requestattributes.include.html";
@@ -380,6 +381,16 @@ public class SlingSpecificsSightlyIT {
}
@Test
+ public void testFormatWithPredefinedStyles() {
+ String url = launchpadURL + SLING_FORMAT;
+ String pageContent = client.getStringContent(url, 200);
+ assertEquals("01.12.1918", HTMLExtractor.innerHTML(url, pageContent, "#format-date-1"));
+ assertEquals("01.12.18", HTMLExtractor.innerHTML(url, pageContent, "#format-date-2"));
+ assertEquals("01.12.18", HTMLExtractor.innerHTML(url, pageContent, "#format-date-3"));
+ assertEquals("Sonntag, 1. Dezember 1918", HTMLExtractor.innerHTML(url, pageContent, "#format-date-4"));
+ }
+
+ @Test
public void testXSSAttributeEscaping() {
String url = launchpadURL + TCK_XSS;
String pageContent = client.getStringContent(url, 200);