Changeset 1159


Ignore:
Timestamp:
12/04/08 04:55:54 (3 years ago)
Author:
ArthurClemens
Message:

Item385: fix unit test after form template changes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/UnitTestContrib/test/unit/RenderFormTests.pm

    r1090 r1159  
    184184    my $res = $meta->renderFormForDisplay(); 
    185185    $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> 
    190187_An issue_ 
    191188</td></tr><tr valign='top'><td class='twikiFormTableRow foswikiFirstCol' align='right'> Issue Description </td><td> 
     
    199196</td></tr><tr valign='top'><td class='twikiFormTableRow foswikiFirstCol' align='right'> Issue 5 </td><td> 
    200197Foo, Baz 
    201 </td></tr></table> 
    202 </div><!-- /foswikiForm --> 
     198</td></tr></table></div><!-- /foswikiForm --> 
    203199HERE 
    204200    ($meta, $text) = 
    205201      $this->{twiki}->{store}->readTopic(undef, $this->{test_web}, $testtopic1); 
    206202    $res = $meta->renderFormForDisplay(); 
     203 
    207204    $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> 
    212206_An issue_ 
    213207</td></tr><tr valign='top'><td class='twikiFormTableRow foswikiFirstCol' align='right'> Issue Description </td><td> 
     
    221215</td></tr><tr valign='top'><td class='twikiFormTableRow foswikiFirstCol' align='right'> Issue 5 </td><td> 
    222216Foo, Baz 
    223 </td></tr></table> 
    224 </div><!-- /foswikiForm --> 
     217</td></tr></table></div><!-- /foswikiForm --> 
    225218HERE 
    226219} 
     
    234227        $this->{twiki}, $this->{test_web}, "InitializationForm" ); 
    235228    my $res = $formDef->renderForEdit($this->{test_web}, $testtopic1, $meta); 
    236  
    237229my $expected = <<HERE; 
    238230<div class="foswikiForm twikiEditForm"><table class="twikiFormTable"> 
    239231<tr> 
    240 <th class="twikiFormTableHRow" colspan="2"><a rel="nofollow" target="InitializationForm" href="%VIEWURL%/TemporaryRenderFormTestsTestWebRenderFormTests/InitializationForm" title="Details in separate window" onclick="return launchWindow(&quot;TemporaryRenderFormTestsTestWebRenderFormTests&quot;,&quot;InitializationForm&quot;)">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(&quot;TemporaryRenderFormTestsTestWebRenderFormTests&quot;,&quot;InitializationForm&quot;)">TemporaryRenderFormTestsTestWebRenderFormTests.InitializationForm</a> <input type="submit" name="action_replaceform" value='Replace form...' class="twikiChangeFormButton twikiButton" /></th> 
    241233</tr>  
    242234<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> 
     
    251243HERE 
    252244 
    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(&quot;TemporaryRenderFormTestsTestWebRenderFormTests&quot;,&quot;InitializationForm&quot;)">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------------------"); 
    336246 
    337247    my $viewUrl = $this->{twiki}->getScriptUrl(0, 'view'); 
Note: See TracChangeset for help on using the changeset viewer.