Page MenuHomePhabricator

LanguageAndLexicalCategoryWidget Vue Test and Prod Template are not in sync
Closed, ResolvedPublic

Description

Due to T198455 the versions on the templates in tests/jasmine/LanguageAndLexicalCategoryWidget.spec.js and LexemeView.php have become out of sync.

Specifically the spec currently includes a native html <input> whereas the production version includes a <item-selector> component.

It is not possible to put them back in sync without causing the jasmine tests to fail. This can be seen in the following PS: https://gerrit.wikimedia.org/r/c/mediawiki/extensions/WikibaseLexeme/+/479183

The tests fail with the widget appearing to be populated by: NaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaN....

This bug was found while working on: T209931 and I suspect due to the fact the entityselector widget from wikibase is not available in the jasmine test environment.

Event Timeline

Addshore added subscribers: Jakob_WMDE, Addshore.

@Jakob_WMDE says that this might be solvable with something new in reosurceloader now. Pinging him to populate this in trailblaze investigation and then we can look at this again soon.

Change 554488 had a related patch set uploaded (by Jakob; owner: Jakob):
[mediawiki/extensions/WikibaseLexeme@master] Sync LanguageAndLexicalCategoryWidget production and test template

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

@Jakob_WMDE says that this might be solvable with something new in reosurceloader now. Pinging him to populate this in trailblaze investigation and then we can look at this again soon.

I obviously didn't read the task description properly when I claimed that, and confused this task with T198455. I still looked into it for a moment, and while I agree that not being able to easily include entityselector in the test, we can work around this in this case by stubbing child components using @vue/test-utils. Here's an almost ok looking patch that does this: https://gerrit.wikimedia.org/r/554488

Since T198455 the templates are in sync, so I think this can be closed. We stumbled upon this task again while working on T266936.

Change 554488 abandoned by Lucas Werkmeister (WMDE):
[mediawiki/extensions/WikibaseLexeme@master] Sync LanguageAndLexicalCategoryWidget production and test template

Reason:
This was eventually done in T198455. (I’m mainly abandoning this change so it stops showing up as “conflicts with” in other changes that happen to touch the same files, such as I7cd23af9bd.)

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