Commit graph

15 commits

Author SHA1 Message Date
Timo Tijhof 0fddc4a258 tests: Remove use of QUnit 1.x setup()/teardown()
No longer supported upstream. Was kept compatible via monkey-patch
in MW core testrunner.js. While at it, also:

* Convert one file from an ad-hoc closure to using the QUnit.module()
  scop, as per <https://api.qunitjs.com/QUnit/module/>.

* Use inline variable declarations per current code conventions.

* Remove needless duplication and description from hardcoded
  assertion message.

Bug: T250045
Change-Id: If556b338c6151108aeebd241b828ccb420c8b857
2022-05-04 10:46:10 +02:00
Ed Sanders aaaa5b63da JS: Update APIs to make more extensible
* Don't require a jQuery element with a specific attribute
  to record thanks. Instead pass in the thanked ID directly.
* In Flow, don't override the cookieName static property,
  instead pass it in as an argument.
  Change the static property (effectively a global) prevents
  us from having multiple types of thanks on the same page.

Change-Id: Ia569f8636f070f2af69f89d7da66c9a6f9821d24
2022-01-25 22:02:15 +00:00
Ed Sanders 1daf4bcf2d build: Update eslint config
Change-Id: If0871326eb35f8cb6ef026784cd04fca5754ab59
2022-01-25 22:01:31 +00:00
libraryupgrader 7662f6c61b build: Updating eslint-config-wikimedia to 0.20.0
Change-Id: I808cbd2471d4cec72df383d03f208ea4d92da106
2021-04-14 10:37:46 +00:00
Gergő Tisza 3d17c58922 Use mw.cookie instead of $.cookie
Bug: T254024
Change-Id: If487ef4d14f308fd6da0d6b938e35dc68dca5b5e
2020-05-29 19:44:12 +00:00
Ed Sanders c033679cb8 build: Update eslint-config-wikimedia
Change-Id: I3cbcbb1695896ddc1e54c40dc0da50f91944916f
2019-12-12 11:36:24 +00:00
jenkins-bot 5d5b82ad65 Merge "Thanks/thank: Add tests for thanked cookie and getUserGender()" 2018-11-16 18:15:38 +00:00
takidelfin 957ee53679 Thanks/thank: Add tests for thanked cookie and getUserGender()
Added two new tests: thanked cookie and gets user gender. First uses jQuery cookies and second uses Sinon fake server

Bug: T160267
Change-Id: I8f5dad9c90e930d557e86acb4b175ec549849e7a
2018-11-16 17:50:58 +01:00
Ed Sanders 18011b81c2 build: Update devDependencies
Change-Id: I4fc1204a4226be26c0bd7f06a06ed57f13c58b6f
2018-11-12 19:27:37 +00:00
Ed Sanders e453114f55 Remove obsolete aliases from closures
Bug: T208951
Change-Id: Ie84c06e4a69923a5993b173d490bfa97189c285b
2018-11-12 19:22:46 +00:00
jdlrobson a6fa3c4977 Do not use PNG for thanks button
Instead use mediawiki.ui and ResourceLoaderImageModule

Other changes:
* Add gender support to thanks-button-thanked

Depends-On: I0745e112d11026ed59d8daca990b313305cd094a
Bug: T198151
Change-Id: I82ae596330aff8387653c65a6bab5ff729641a80
2018-08-09 17:13:21 +00:00
James D. Forrester 6bf8fd0b11 tests: Make compartible with QUnit 2
Change-Id: I726d7f75e37a759e1b1f6372710cb06f754fc94b
2017-10-23 13:38:11 -07:00
James D. Forrester e315e954a6 build: Replace jshint and jscs with eslint; drop csslint
Removing csslint rather than replacing it with stylelint as there
are no CSS or LESS files in this repo.

Also bumping banana and jsonlint to latest.

Change-Id: I9ffce273f63b061e07c3fa90ab4e82b5e551aa92
2017-08-03 17:24:34 -07:00
Glaisher 703642e40e Hide thanks button for botedits if bots are not allowed to receive thanks in mobile as well
Also only load 'ext.thanks.mobilediff' module if the recipient is not an IP.

Bug: T118686
Change-Id: I096d3b05a46590db426ae038f17f6e180fa5bf37
2015-11-24 22:47:56 +05:00
jdlrobson e02c334880 Add tests for rendering of thanks button on mobile diff page
This has broken many times and I want this test to ensure its protection
in future.

Bug: T86687
Change-Id: Iea01c5c7c1ba00de47182521eeba86c8aef03522
2015-01-28 12:48:08 -08:00