Skip to content

Commit 54a2c1d

Browse files
bpamiriclaude
andcommitted
fix: account for HTML encoding in HTML5 form helper tests
Tests checking specific attribute values (email, URL, tel, color, search) now pass encode=false since default encoding transforms special characters (@ : / + # space) into HTML entities. Encoding behavior is tested separately in the encoding support describe block. Co-Authored-By: Claude Opus 4.6 <[email protected]>
1 parent a1cdb86 commit 54a2c1d

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

vendor/wheels/tests_testbox/specs/view/html5FormHelpersSpec.cfc

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ component extends="wheels.Testbox" {
2525
});
2626

2727
it("sets the correct value attribute", function() {
28-
local.result = _controller.emailFieldTag(name = "userEmail", value = "[email protected]");
28+
local.result = _controller.emailFieldTag(name = "userEmail", value = "[email protected]", encode = false);
2929
expect(local.result).toInclude('value="[email protected]"');
3030
});
3131

@@ -45,7 +45,8 @@ component extends="wheels.Testbox" {
4545
name = "userEmail",
4646
value = "",
4747
class = "form-control",
48-
placeholder = "[email protected]"
48+
placeholder = "[email protected]",
49+
encode = false
4950
);
5051
expect(local.result).toInclude('class="form-control"');
5152
expect(local.result).toInclude('placeholder="[email protected]"');
@@ -64,7 +65,7 @@ component extends="wheels.Testbox" {
6465
});
6566

6667
it("sets the correct value", function() {
67-
local.result = _controller.urlFieldTag(name = "website", value = "https://example.com");
68+
local.result = _controller.urlFieldTag(name = "website", value = "https://example.com", encode = false);
6869
expect(local.result).toInclude('value="https://example.com"');
6970
});
7071
});
@@ -122,7 +123,7 @@ component extends="wheels.Testbox" {
122123
});
123124

124125
it("sets the correct value", function() {
125-
local.result = _controller.telFieldTag(name = "phone", value = "+1234567890");
126+
local.result = _controller.telFieldTag(name = "phone", value = "+1234567890", encode = false);
126127
expect(local.result).toInclude('value="+1234567890"');
127128
});
128129
});
@@ -161,7 +162,7 @@ component extends="wheels.Testbox" {
161162
});
162163

163164
it("sets the color value", function() {
164-
local.result = _controller.colorFieldTag(name = "themeColor", value = "##336699");
165+
local.result = _controller.colorFieldTag(name = "themeColor", value = "##336699", encode = false);
165166
expect(local.result).toInclude('value="##336699"');
166167
});
167168
});
@@ -203,7 +204,7 @@ component extends="wheels.Testbox" {
203204
});
204205

205206
it("sets the correct value", function() {
206-
local.result = _controller.searchFieldTag(name = "query", value = "wheels framework");
207+
local.result = _controller.searchFieldTag(name = "query", value = "wheels framework", encode = false);
207208
expect(local.result).toInclude('value="wheels framework"');
208209
});
209210

0 commit comments

Comments
 (0)