<p dir="ltr"><br>
On 25-May-2015 2:48 am, "Atul Pratap Singh" <<a href="mailto:atulpratapsingh05@gmail.com">atulpratapsingh05@gmail.com</a>> wrote:<br>
><br>
> On Sun, May 24, 2015 at 10:08 PM, 章浩 <<a href="mailto:jason.daurus@gmail.com">jason.daurus@gmail.com</a>> wrote:<br>
>><br>
>> Hi Singh,<br>
>><br>
>> Recently I am working on templates of `tbl_column_definitions.lib.php`, and I need some help from you.<br>
>><br>
>> I met a problem on the unit test:<br>
>><br>
>> And here is the test code raise the problem:<br>
>><br>
>> The failure is caused by the format of HTML, which will not cause any side effects for user interface. So what should I do to handle this kind of error? Merging spaces in a HTML tag may help, but it seems difficult to distinguish a special case:<br>
>><br>
>> Before trimming:<br>
>><br>
>> <script>someScript(); //<br>
>><br>
>> anotherScript();</script><br>
>><br>
>> After trimming:<br>
>><br>
>> <script>someScript(); // anotherScript();</script><br>
>><br>
>> It's obvious that it will cause some Javascripts being commented. Then I figured out a second solution: modify the test scripts and let it pass. This is a "palliative" solution, we have to spend plenty of time to fix this kind of problems.<br>
>><br>
>> Maybe we could use a more effective way to test front-end components (templates, pages, etc) in the future, though I haven’t figure out how to achieve this goal yet.<br>
>><br>
>> Could you give me some suggestions about this?<br>
><br>
><br>
> Hi devs,<br>
><br>
> I share Jason's confusion above and doubt the usefulness of unit tests that are just asserting for static HTML strings in a dynamic HTML output and one that will keep evolving with course of development.<br>
><br>
> Also I wonder about its importance as we move to template system[0], opinions are welcome for possible better ways of doing it. Maybe we can just test for valid input data getting used by the template and some important key words but not HTML tags[1]</p>
<p dir="ltr">I also think that asserting HTML tags is of less use and we should test only few keywords. UI should be tested using selenium.</p>
<p dir="ltr">><br>
><br>
> [0]<a href="https://github.com/phpmyadmin/phpmyadmin/pull/1642#discussion_r28551465"> https://github.com/phpmyadmin/phpmyadmin/pull/1642#discussion_r28551465</a> <br>
> [1] <a href="http://stackoverflow.com/questions/3429218/unit-tests-for-html-output">http://stackoverflow.com/questions/3429218/unit-tests-for-html-output</a><br>
><br>
>> Best regards,<br>
>><br>
>> Jason<br>
>><br>
>><br>
><br>
><br>
> --<br>
> Atul Pratap Singh<br>
><br>
> ------------------------------------------------------------------------------<br>
> One dashboard for servers and applications across Physical-Virtual-Cloud<br>
> Widest out-of-the-box monitoring support with 50+ applications<br>
> Performance metrics, stats and reports that give you Actionable Insights<br>
> Deep dive visibility with transaction tracing using APM Insight.<br>
><a href="http://ad.doubleclick.net/ddm/clk/290420510;117567292;y"> http://ad.doubleclick.net/ddm/clk/290420510;117567292;y</a><br>
> _______________________________________________<br>
> Phpmyadmin-devel mailing list<br>
><a href="mailto:Phpmyadmin-devel@lists.sourceforge.net"> Phpmyadmin-devel@lists.sourceforge.net</a><br>
><a href="https://lists.sourceforge.net/lists/listinfo/phpmyadmin-devel"> https://lists.sourceforge.net/lists/listinfo/phpmyadmin-devel</a><br>
><br>
</p>