Page MenuHomePhabricator

Add unit tests to MobileFrontend extension
Closed, ResolvedPublic

Description

Were severely lacking them in this extension.


Version: unspecified
Severity: normal

Details

Reference
bz30388
TitleReferenceAuthorSource BranchDest Branch
Links for search languagessebastian-berlin-wmse/wikipedia-homepage!8sebastian-berlin-wmsesearch-languagemain
Links for search languagessebastian-berlin-wmse/wikipedia-homepage!6sebastian-berlin-wmsesearch-languagemain
Add i18n with flask-babelsebastian-berlin-wmse/wikipedia-homepage!2sebastian-berlin-wmseadd-i18nmain
Port to pythonsebastian-berlin-wmse/wikipedia-homepage!1sebastian-berlin-wmseport-to-pythonmain
Customize query in GitLab

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 11:53 PM
bzimport set Reference to bz30388.
bzimport added a subscriber: Unknown Object (MLST).

Examples of things to test:

In phpunit?

  • run some known user-agent strings etc through the magic breakdown to confirm they bring up the settings we expect

In ...... some sort of client-side environment?

  • masquerade as particular clients and ensure that you actually get the expected layout times
  • masquerade as a web client that remembers cookies and confirm that clicking through the various 'view in desktop', 'view in mobile', etc links act as expected

preilly wrote:

Basic unit test support has been added in r96938. Now it's time to add some meaningful tests simular to what Brion mentioned in Comment 1.

Seeing this:
https://www.mediawiki.org/wiki/Extension_talk:MobileFrontend#Issues_with_MobileFrontend_and_possible_rewrite_11940
I thought some unit tests might now be useful.

This diff: http://jonrobson.me.uk/mediawiki/MobileFrontendTests.diff
suggests a possible test suite using qunit and suggest some tests to get started for opensearch.js and application.js. I also have some tests for the beta_ code (not attached) that I am still working on.

To use run

make remotes

then navigate to tests/client/index.html in your localhost (the tests to do with cookies will not run off a file uri)

Javascript tests were adding in r111741

preilly wrote:

(In reply to comment #2)

Basic unit test support has been added in r96938. Now it's time to add some
meaningful tests simular to what Brion mentioned in Comment 1.

s/simular/similar