Page MenuHomePhabricator

Create tests for Add interlanguage links
Open, Needs TriagePublic

Description

In T390949 we introduced changes that broke the "Add interlanguage links" functionality for logged-in users for pages that didn't already have links. This was reported as a regression in T390949 and the bug was fixed in production with a backport (https://gerrit.wikimedia.org/r/c/1134190).

To avoid similar such regressions in the future, add a test of the functionality to an existing testsuite / test suites. QUnit tests might be the simplest (and should be able to catch a bug like this), but integration tests would catch a broader range of possible failures.

Acceptance Criteria

  • Tests of the interlanguage links functionality exist, run and pass in CI (minimumly that the popup loads)
  • Modifying the code to revert https://gerrit.wikimedia.org/r/c/1134190 causes the tests to fail

Note: There are no integration tests for this as its complicated, this topic will be handled in TBD

Event Timeline

hoo moved this task from The Backlog to The Board on the Wikidata-Omega board.
hoo edited projects, added Wikidata-Omega (The Board); removed Wikidata-Omega.
hoo moved this task from new to the board to In Development on the Wikidata-Omega (The Board) board.

Change #1136784 had a related patch set uploaded (by Hoo man; author: Hoo man):

[mediawiki/extensions/Wikibase@master] Add very basic selenium test for client's linkitem

https://gerrit.wikimedia.org/r/1136784

Added a browser test setup similar to the repo one for client, and created a very trivial test making sure the linkitem pop up loads. The test fails for me after reverting 09281858f21eb5d8a34666ce599fa130c519b7f4.

ArthurTaylor added a subscriber: hoo.

Looks like it's failing with some parsing errors:

21:18:51 /src/client/tests/selenium/pageobjects/linkitem.page.js
21:18:51   5:8  error  Parsing error: Unexpected token open
21:18:51 
21:18:51 /src/client/tests/selenium/specs/linkitem.js
21:18:51   9:19  error  Parsing error: Unexpected token =>
21:18:51 
21:18:51 /src/client/tests/selenium/wdio.conf.js
21:18:51   11:2  error  Parsing error: Unexpected token ..

https://integration.wikimedia.org/ci/job/mwgate-node20/38786/console

Looks like it's failing with some parsing errors:
[…]
https://integration.wikimedia.org/ci/job/mwgate-node20/38786/console

I forgot to add the eslint config for the new folder. Fixed this afternoon.

Change #1136784 merged by jenkins-bot:

[mediawiki/extensions/Wikibase@master] Add very basic selenium test for client's linkitem

https://gerrit.wikimedia.org/r/1136784