Changeset 1159
- Timestamp:
- 12/04/08 04:55:54 (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/UnitTestContrib/test/unit/RenderFormTests.pm
r1090 r1159 184 184 my $res = $meta->renderFormForDisplay(); 185 185 $this->assert_html_equals(<<HERE, $res); 186 <div class="foswikiForm"> 187 <table class='twikiFormTable' border='1'><tr><th class='twikiFormTableHRow foswikiFirstCol' colspan='2'> 188 [[$this->{test_web}.InitializationForm][InitializationForm]] 189 </th></tr><tr valign='top'><td class='twikiFormTableRow foswikiFirstCol' align='right'> Issue Name </td><td> 186 <div class="foswikiForm"><h3>[[TemporaryRenderFormTestsTestWebRenderFormTests.InitializationForm][InitializationForm]] <span class='patternSmallLinkToHeader'><a href='%SCRIPTURL{edit}%/%WEB%/%TOPIC%?t=%GMTIME{\$epoch}%;action=form'>%MAKETEXT{"edit"}%</a></span></h3><table class='twikiFormTable' border='1'><tr valign='top'><td class='twikiFormTableRow foswikiFirstCol' align='right'> Issue Name </td><td> 190 187 _An issue_ 191 188 </td></tr><tr valign='top'><td class='twikiFormTableRow foswikiFirstCol' align='right'> Issue Description </td><td> … … 199 196 </td></tr><tr valign='top'><td class='twikiFormTableRow foswikiFirstCol' align='right'> Issue 5 </td><td> 200 197 Foo, Baz 201 </td></tr></table> 202 </div><!-- /foswikiForm --> 198 </td></tr></table></div><!-- /foswikiForm --> 203 199 HERE 204 200 ($meta, $text) = 205 201 $this->{twiki}->{store}->readTopic(undef, $this->{test_web}, $testtopic1); 206 202 $res = $meta->renderFormForDisplay(); 203 207 204 $this->assert_html_equals(<<HERE, $res); 208 <div class="foswikiForm"> 209 <table class='twikiFormTable' border='1'><tr><th class='twikiFormTableHRow foswikiFirstCol' colspan='2'> 210 [[$this->{test_web}.InitializationForm][InitializationForm]] 211 </th></tr><tr valign='top'><td class='twikiFormTableRow foswikiFirstCol' align='right'> Issue Name </td><td> 205 <div class="foswikiForm"><h3>[[TemporaryRenderFormTestsTestWebRenderFormTests.InitializationForm][InitializationForm]] <span class='patternSmallLinkToHeader'><a href='%SCRIPTURL{edit}%/%WEB%/%TOPIC%?t=%GMTIME{\$epoch}%;action=form'>%MAKETEXT{"edit"}%</a></span></h3><table class='twikiFormTable' border='1'><tr valign='top'><td class='twikiFormTableRow foswikiFirstCol' align='right'> Issue Name </td><td> 212 206 _An issue_ 213 207 </td></tr><tr valign='top'><td class='twikiFormTableRow foswikiFirstCol' align='right'> Issue Description </td><td> … … 221 215 </td></tr><tr valign='top'><td class='twikiFormTableRow foswikiFirstCol' align='right'> Issue 5 </td><td> 222 216 Foo, Baz 223 </td></tr></table> 224 </div><!-- /foswikiForm --> 217 </td></tr></table></div><!-- /foswikiForm --> 225 218 HERE 226 219 } … … 234 227 $this->{twiki}, $this->{test_web}, "InitializationForm" ); 235 228 my $res = $formDef->renderForEdit($this->{test_web}, $testtopic1, $meta); 236 237 229 my $expected = <<HERE; 238 230 <div class="foswikiForm twikiEditForm"><table class="twikiFormTable"> 239 231 <tr> 240 <th class="twikiFormTableHRow" colspan="2"><a rel="nofollow" target="InitializationForm" href="%VIEWURL%/TemporaryRenderFormTestsTestWebRenderFormTests/InitializationForm" title="Details in separate window" onclick="return launchWindow("TemporaryRenderFormTestsTestWebRenderFormTests","InitializationForm")">TemporaryRenderFormTestsTestWebRenderFormTests.InitializationForm</a> <input type="submit" name="action_replaceform" value='Replace form...' class="twikiChangeFormButton twikiButton" onclick="suppressSaveValidation()"/></th>232 <th class="twikiFormTableHRow" colspan="2"><a rel="nofollow" target="InitializationForm" href="%VIEWURL%/TemporaryRenderFormTestsTestWebRenderFormTests/InitializationForm" title="Details in separate window" onclick="return launchWindow("TemporaryRenderFormTestsTestWebRenderFormTests","InitializationForm")">TemporaryRenderFormTestsTestWebRenderFormTests.InitializationForm</a> <input type="submit" name="action_replaceform" value='Replace form...' class="twikiChangeFormButton twikiButton" /></th> 241 233 </tr> 242 234 <tr><th align="right">Issue Name</th><td align="left"><input type="text" name="IssueName" value="_An issue_" size="40" class="twikiInputField twikiEditFormTextField" /></td></tr> … … 251 243 HERE 252 244 253 my $oldstuff=<<HERE; 254 <div class="foswikiForm twikiEditForm"> 255 <table class="twikiFormTable"> 256 <tr> 257 <th class="twikiFormTableHRow" colspan="2"> 258 <a rel="nofollow" target="InitializationForm" href="%VIEWURL%/TemporaryRenderFormTestsTestWebRenderFormTests/InitializationForm" title="Click to see details in separate window" onclick="return launchWindow("TemporaryRenderFormTestsTestWebRenderFormTests","InitializationForm")">TemporaryRenderFormTestsTestWebRenderFormTests.InitializationForm</a> 259 <input type="submit" name="action_replaceform" value='Replace form...' class="twikiChangeFormButton twikiButton" /> 260 </th> 261 </tr> 262 <tr> 263 <th align="right"> 264 Issue Name 265 </th> 266 <td align="left"> 267 <input type="text" name="IssueName" value="_An issue_" size="40" class="twikiInputField twikiEditFormTextField" /> 268 </td> 269 </tr> 270 <tr> 271 <th align="right"> 272 State</th> 273 <td align="left"> 274 <table> 275 <tr> 276 <td> 277 <label> 278 <input type="radio" name="State" value="none" label="none" class="twikiRadioButton twikiEditFormRadioField"/> 279 none 280 </label> 281 </td> 282 </tr> 283 </table> 284 </td> 285 </tr> 286 <tr> 287 <th align="right"> 288 Issue Description 289 </th> 290 <td align="left"><input type="hidden" name="IssueDescription" value="---+ Example problem" /> 291 <div class="twikiEditFormLabelField"> 292 <nop> 293 <h1> 294 <a name="Example_problem"></a> Example problem 295 </h1> 296 </div> 297 </td> 298 </tr> 299 <tr> 300 <th align="right"> 301 Issue 1 302 </th> 303 <td align="left"> 304 <select name="Issue1" class="twikiSelect twikiEditFormSelect" size="1"> 305 </select> 306 </td> 307 </tr> 308 <tr> 309 <th align="right"> 310 Issue 2EXTRA 311 </th> 312 <td align="left">SWEET 313 </td></tr> 314 <tr> 315 <th align="right"> 316 Issue 3 317 </th> 318 <td align="left"> 319 <table></table> 320 <input type="hidden" name="Issue3" value="" /> 321 </td> 322 </tr> 323 <tr> 324 <th align="right"> 325 Issue 4 326 </th> 327 <td align="left"> 328 <textarea name="Issue4" rows="4" cols="50" class="twikiInputField twikiEditFormTextAreaField"> 329 Defect 330 </textarea> 331 </td> 332 </tr> 333 </table> 334 </div> 335 HERE 245 Foswiki::Func::writeDebug("-----------------\n$res\n------------------"); 336 246 337 247 my $viewUrl = $this->{twiki}->getScriptUrl(0, 'view');
Note: See TracChangeset
for help on using the changeset viewer.
