Skip to content

Commit

Permalink
ZK-5839: ZK-5839 Follow up on ZK-5696: missing nested shadow element …
Browse files Browse the repository at this point in the history
…after fix
  • Loading branch information
jumperchen committed Nov 8, 2024
1 parent 6851186 commit 13b58f2
Show file tree
Hide file tree
Showing 4 changed files with 70 additions and 0 deletions.
1 change: 1 addition & 0 deletions zkdoc/release-note
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ ZK 10.1.0
ZK-5833: ZK-423 regression on Android
ZK-4960: Listbox doesn't keep scrollbar position when applying hflex="min" on a listheader in mobile
ZK-4961: Unable to scroll in grid and listbox when using non-native scrollbar on mobile
ZK-5839: ZK-5839 Follow up on ZK-5696: missing nested shadow element after fix

* Upgrade Notes
+ Remove Htmls.encodeJavaScript(), Strings.encodeJavaScript(), Strings.escape() with Strings.ESCAPE_JAVASCRIPT, and replace them with OWASP Java Encoder APIs instead.
Expand Down
35 changes: 35 additions & 0 deletions zktest/src/main/webapp/test2/B101-ZK-5839.zul
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?xml version="1.0" encoding="UTF-8"?>

<!--
B101-ZK-5839.zul
Purpose:
Description:
History:
2024/11/7, Created by jumperchen
Copyright (C) 2024 Potix Corporation. All Rights Reserved.
-->
<zk>
<zscript><![CDATA[
int counter = 0;
ListModelList items = new ListModelList();
]]></zscript>
<div apply="org.zkoss.bind.BindComposer">
<forEach items="@init(items)">
<div>
<if test="@init(true)">
AAA
<if test="@init(true)">
BBB
</if>
CCC
</if>
</div>
</forEach>
</div>
<button onClick="items.add(++counter)" label="add"/>
</zk>
1 change: 1 addition & 0 deletions zktest/src/main/webapp/test2/config.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3154,6 +3154,7 @@ B90-ZK-4431.zul=A,E,Multislider
##zats##B101-ZK-5802.zul=A,E,JavaScript,Private,Function,Export,Override
##zats##B101-ZK-5810.zul=A,E,XEL,ZUL,ClientMVVM
##zats##B101-ZK-5777.zul=A,E,SendRedirect,Encoding
##zats##B101-ZK-5839.zul=A,E,Shadow,ForEach,Model,MVVM,Diff-merge

##
# Features - 3.0.x version
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/* B101_ZK_5839Test.java
Purpose:
Description:
History:
5:21 PM 2024/11/7, Created by jumperchen
Copyright (C) 2024 Potix Corporation. All Rights Reserved.
*/
package org.zkoss.zktest.zats.test2;

import static org.junit.jupiter.api.Assertions.assertEquals;

import org.junit.jupiter.api.Test;

import org.zkoss.test.webdriver.WebDriverTestCase;

/**
* @author jumperchen
*/
public class B101_ZK_5839Test extends WebDriverTestCase {
@Test
public void test() {
connect();
for (int i = 0; i < 5; i++) {
click(jq(".z-button"));
waitResponse();
assertEquals("AAABBBCCC", jq(".z-div .z-div:eq("+i+")").text().replaceAll("[^A-Z]", ""));
}
}
}

0 comments on commit 13b58f2

Please sign in to comment.