Page MenuHomePhabricator

Fix VisualEditor unit test failures on Firefox headless
Closed, ResolvedPublic

Description

Unit tests currently fail on Firefox headless (See https://gerrit.wikimedia.org/r/#/c/VisualEditor/VisualEditor/+/524816/3/ ), even though they succeed in Chromium and Firefox non-headless. See below for failure details.

The problem is ve.ce.Surface#getOffsetFromCoords behaves in a fairly arbitrary way in the ve.ce.TableNode unit tests, where a fake click event is passed with x,y coordinates pointing to nowhere meaningful.

Failure details:

	Selection after double click
	Expected: {
	  "range": {
	    "from": 94,
	    "to": 94,
	    "type": "range"
	  },
	  "type": "linear"
	}
	Actual: {
	  "range": {
	    "from": 0,
	    "to": 0,
	    "type": "range"
	  },
	  "type": "linear"
	}
	@tests/ce/nodes/ve.ce.TableNode.test.js:98:2
	runTest@node_modules/qunit/qunit/qunit.js:3044:16
	run@node_modules/qunit/qunit/qunit.js:3030:6
	runTest/<@node_modules/qunit/qunit/qunit.js:3257:7
	processTaskQueue@node_modules/qunit/qunit/qunit.js:2623:24
	processTaskQueue/<@node_modules/qunit/qunit/qunit.js:2627:8
	
	
	Selection after Shift-click on another cell
	Expected: {
	  "fromCol": 3,
	  "fromRow": 3,
	  "tableRange": {
	    "from": 0,
	    "to": 171,
	    "type": "range"
	  },
	  "toCol": 0,
	  "toRow": 5,
	  "type": "table"
	}
	Actual: {
	  "fromCol": 0,
	  "fromRow": 3,
	  "tableRange": {
	    "from": 0,
	    "to": 171,
	    "type": "range"
	  },
	  "toCol": 0,
	  "toRow": 3,
	  "type": "table"
	}
	@tests/ce/nodes/ve.ce.TableNode.test.js:116:2
	runTest@node_modules/qunit/qunit/qunit.js:3044:16
	run@node_modules/qunit/qunit/qunit.js:3030:6
	runTest/<@node_modules/qunit/qunit/qunit.js:3257:7
	processTaskQueue@node_modules/qunit/qunit/qunit.js:2623:24
	processTaskQueue/<@node_modules/qunit/qunit/qunit.js:2627:8

Event Timeline

dchan created this task.Jul 23 2019, 3:11 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptJul 23 2019, 3:11 PM

Change 525111 had a related patch set uploaded (by Divec; owner: Divec):
[VisualEditor/VisualEditor@master] Fix TableNode unit test getOffsetFromCoords failure on Firefox

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

dchan moved this task from To Triage to Current work on the VisualEditor board.Jul 23 2019, 3:49 PM
dchan edited projects, added VisualEditor (Current work); removed VisualEditor.
dchan moved this task from Incoming to Code review on the VisualEditor (Current work) board.

Change 525111 merged by jenkins-bot:
[VisualEditor/VisualEditor@master] Fix TableNode unit test getOffsetFromCoords failure on Firefox

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

Change 525152 had a related patch set uploaded (by Bartosz Dziewoński; owner: Bartosz Dziewoński):
[mediawiki/extensions/VisualEditor@master] Update VE core submodule to master (6045a533f)

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

Change 522482 had a related patch set uploaded (by Bartosz Dziewoński; owner: Esanders):
[mediawiki/extensions/VisualEditor@master] Update VE core submodule to 962335a40293cf4b1314c0236788f35f080ae877

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

Change 522482 merged by jenkins-bot:
[mediawiki/extensions/VisualEditor@master] Update VE core submodule to 962335a40293cf4b1314c0236788f35f080ae877

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

ppelberg closed this task as Resolved.Aug 28 2019, 3:51 AM