? Success

User tests: Successful: Unsuccessful:

avatar Ruchiranga
Ruchiranga
28 Jun 2016

Changing sendmailtest.js code structure for testing

Summary of changes

Joomla's Google Summer of Code JavaScript test project targets in writing tests with Jasmine for all JavaScript libraries in core. The sendtestmail.js has its callback function directly passed into the jQuery(document).ready() function, which makes it impossible to test.

This PR changes the structure (not functionality) of sendtestmail in order to make it testable.

Testing Instructions

Just review the code (functionality did not change) and / or use the test email feature at the global configuration.

avatar Ruchiranga Ruchiranga - open - 28 Jun 2016
avatar Ruchiranga Ruchiranga - change - 28 Jun 2016
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 28 Jun 2016
Labels Added: ?
avatar Ruchiranga Ruchiranga - change - 28 Jun 2016
The description was changed
avatar Ruchiranga Ruchiranga - change - 28 Jun 2016
The description was changed
avatar Ruchiranga Ruchiranga - change - 28 Jun 2016
The description was changed
avatar brianteeman brianteeman - change - 28 Jun 2016
Category Code style JavaScript
avatar zero-24
zero-24 - comment - 29 Jun 2016

hmm i don't know why but if i apply this patch and try to send a test mail nothing happens. I have cleared the cache bevor reloading the page. Can you have a look that it is not a local issue by me? Thanks.

avatar Ruchiranga
Ruchiranga - comment - 29 Jun 2016

@zero-24 I tried it with SMTP just now and it worked as it should. Got the Success message on top and got the email delivered to my mail box as well. May be it is a local issue.

Before clicking Send Test Mail

Before

After clicking

After


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/10953.

avatar andrepereiradasilva andrepereiradasilva - test_item - 29 Jun 2016 - Tested successfully
avatar andrepereiradasilva
andrepereiradasilva - comment - 29 Jun 2016

I have tested this item successfully on 8896899

Works as described, it's easier to see the code changes without white spaces changes https://github.com/joomla/joomla-cms/pull/10953/files?w=1

Anyway, i would like it even better if jQuery is removed all together ?

But this js is a more complex case to remove jQuery because of the ajax requests.
For that joomla would need to have some sort of vanilla js ajax request function in core.js and also for events.

Maybe for the future.


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/10953.

avatar yvesh yvesh - test_item - 29 Jun 2016 - Tested successfully
avatar yvesh
yvesh - comment - 29 Jun 2016

I have tested this item successfully on 8896899

Works fine for me. @zero-24 can you please test again?

@andrepereiradasilva yes for testability (in terms of unit tests)dropping jQuery would be a big step forward. But without jQuery, Xhr requests and many other, with jQuery trivial things are a mess.

Better would be a switch to something like Angular 2 (for SoC, SRP etc.) ;-)

screenshot 2016-06-29 20 41 23


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/10953.

avatar zero-24
zero-24 - comment - 29 Jun 2016

@andrepereiradasilva

Can you point me to the docs where I can see these github features?

avatar zero-24 zero-24 - change - 29 Jun 2016
Status Pending Ready to Commit
avatar zero-24
zero-24 - comment - 29 Jun 2016

RTC based on testing


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/10953.

avatar joomla-cms-bot joomla-cms-bot - change - 29 Jun 2016
Labels Added: ?
avatar andrepereiradasilva
andrepereiradasilva - comment - 30 Jun 2016
avatar roland-d roland-d - change - 16 Jul 2016
Milestone Added:
avatar roland-d roland-d - change - 23 Jul 2016
Status Ready to Commit Information Required
Labels
avatar wilsonge wilsonge - close - 25 Jul 2016
avatar wilsonge wilsonge - merge - 25 Jul 2016
avatar joomla-cms-bot joomla-cms-bot - close - 25 Jul 2016
avatar wilsonge wilsonge - change - 25 Jul 2016
Status Information Required Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2016-07-25 09:12:09
Closed_By wilsonge
avatar joomla-cms-bot joomla-cms-bot - change - 25 Jul 2016
Category Code style JavaScript Code style
avatar joomla-cms-bot joomla-cms-bot - change - 25 Jul 2016
Labels Removed: ?

Add a Comment

Login with GitHub to post a comment