?
avatar mbabker
mbabker
14 Aug 2016

https://github.com/joomla/joomla-cms/blob/staging/tests/javascript/package.json

Joomla ships with jQuery 1.12 right now yet the tests appear to be using jQuery 2. Is there any particular reason for this? Seems like we'd be better off testing against the dependencies we use.

//cc @yvesh @Ruchiranga

avatar mbabker mbabker - open - 14 Aug 2016
avatar brianteeman brianteeman - change - 14 Aug 2016
Category JavaScript Unit Tests
avatar brianteeman brianteeman - change - 14 Aug 2016
Status New Discussion
avatar brianteeman brianteeman - change - 15 Aug 2016
Labels Added: ?
avatar Ruchiranga
Ruchiranga - comment - 16 Aug 2016

I agree. We can go with jQuery 1.12 here.
But the tests written for combobox.js needs the latest jQuery version (3.1.0) to run some of its tests successfully. Those test cases required triggering the Down arrow key keyup event and that only worked when the jQuery version was updated to the latest version.
The combobox.js test suite has not yet been merged to the core. But when we do, we are going to need to have jQuery version 3.1.0. How do you suggest we handle that? :)

avatar C-Lodder
C-Lodder - comment - 22 Aug 2016

You should probably look at an alternative. You cannot load jQuery 1.x and 3.1 as you'll run into conflicts. Joomla uses jQuery 1.x so surely this was taken into consideration beforehand?

avatar Ruchiranga
Ruchiranga - comment - 26 Aug 2016

No I was not suggesting loading both 1.x and 3.1 in running tests. We can use 3.1 for the JavaScript tests only.
But if keeping the versions similar in both Joomla and the tests is more important, we simply can drop the few test cases that require jQuery 3.1 too.
@C-Lodder @mbabker What are your thoughts?

avatar mbabker
mbabker - comment - 26 Aug 2016

To me it'd be better if the tests were running against the same versions we're using in production. If it were a difference in minor branches it'd be one thing, but we're talking about major version differences and jQuery has dropped browser support for browser's we're still supporting. It's great the tests are there, but if they're using versions of dependencies we aren't, it makes the test cases less accurate.

In PHP relations, it'd be like us writing a mail test suite against PHPMailer 6.0 even though we use 5.2 (which has several B/C breaking changes).

avatar C-Lodder
C-Lodder - comment - 26 Aug 2016

Agreed

avatar Ruchiranga
Ruchiranga - comment - 26 Aug 2016

Okay. I'll open a PR changing the jQuery version to 1.12.
And as for the test cases that need jQuery 3.1, I'll just drop them then. Thanks :)

avatar brianteeman
brianteeman - comment - 26 Aug 2016

Closed as we have a pr #11809 thank you

avatar brianteeman brianteeman - close - 26 Aug 2016
avatar brianteeman brianteeman - change - 26 Aug 2016
Status Discussion Closed
Closed_Date 0000-00-00 00:00:00 2016-08-26 18:24:55
Closed_By brianteeman

Add a Comment

Login with GitHub to post a comment