User tests: Successful: Unsuccessful:
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.
Status | New | ⇒ | Pending |
Labels |
Added:
?
|
Category | ⇒ | Code style JavaScript |
@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
After clicking
I have tested this item
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.
I have tested this item
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.) ;-)
Can you point me to the docs where I can see these github features?
Status | Pending | ⇒ | Ready to Commit |
RTC based on testing
Labels |
Added:
?
|
Milestone |
Added: |
Status | Ready to Commit | ⇒ | Information Required |
Labels |
Status | Information Required | ⇒ | Fixed in Code Base |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2016-07-25 09:12:09 |
Closed_By | ⇒ | wilsonge |
Category | Code style JavaScript | ⇒ | Code style |
Labels |
Removed:
?
|
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.