Page MenuHomePhabricator

Failing test: ve.ui.DiffElement (Cite)
Closed, ResolvedPublic

Description

Affecting multiple repos, e.g.:
https://gerrit.wikimedia.org/r/c/mediawiki/extensions/Translate/+/757098
https://integration.wikimedia.org/ci/job/quibble-vendor-mysql-php72-noselenium-docker/131691/console

https://gerrit.wikimedia.org/r/c/mediawiki/extensions/WikibaseQualityConstraints/+/757095
https://integration.wikimedia.org/ci/job/quibble-vendor-mysql-php72-noselenium-docker/131687/console

ve.ui.DiffElement (Cite)
  ✖ Diffing
  Simple ref change
  Expected: {
    "attributes": {
      "class": "ve-ui-diffElement-document"
    },
    "children": [.],
    "html": "<div class=\"ve-ui-diffElement-document\"><div class=\"ve-ui-diffElement-spacer\">⋮</div><h2 data-diff-action=\"none\">Notes</h2><div><ol start=\"1\"><li><p data-diff-action=\"none\">Foo</p></li></ol><ol start=\"2\"><li>Bar<ins data-diff-action=\"insert\"> ish</ins></li></ol><ol start=\"3\"><li><p data-diff-action=\"none\">Baz</p></li></ol></div></div>",
    "text": "⋮NotesFooBar ishBaz",
    "type": "div"
  }
  Actual: {
    "attributes": {
      "class": "ve-ui-diffElement-document"
    },
    "children": [.],
    "html": "<div class=\"ve-ui-diffElement-document\"><div class=\"ve-ui-diffElement-spacer\">⋮</div><h2 data-diff-action=\"none\">Notes</h2><ol><li value=\"1\"><p data-diff-action=\"none\">Foo</p></li><li value=\"2\">Bar<ins data-diff-action=\"insert\"> ish</ins></li><li value=\"3\"><p data-diff-action=\"none\">Baz</p></li></ol></div>",
    "text": "⋮NotesFooBar ishBaz",
    "type": "div"
  }
      at Object.ve.test.utils.runDiffElementTest

It seems the difference is <ol start=\"3\"><li> vs <li value=\"3\">.

Detailed
FAILED TESTS:
  ve.ui.DiffElement (Cite)
    ✖ Diffing
      Chrome Headless 90.0.4430.212 (Linux x86_64)
    Simple ref change
    Expected: {
      "attributes": {
        "class": "ve-ui-diffElement-document"
      },
      "children": [
        {
          "attributes": {
            "class": "ve-ui-diffElement-spacer"
          },
          "children": [
            {
              "attributes": {},
              "children": [],
              "text": "⋮",
              "type": "#text"
            }
          ],
          "html": "<div class=\"ve-ui-diffElement-spacer\">⋮</div>",
          "text": "⋮",
          "type": "div"
        },
        {
          "attributes": {
            "data-diff-action": "none"
          },
          "children": [
            {
              "attributes": {},
              "children": [],
              "text": "Notes",
              "type": "#text"
            }
          ],
          "html": "<h2 data-diff-action=\"none\">Notes</h2>",
          "text": "Notes",
          "type": "h2"
        },
        {
          "attributes": {},
          "children": [
            {
              "attributes": {
                "start": "1"
              },
              "children": [
                {
                  "attributes": {},
                  "children": [
                    {
                      "attributes": {
                        "data-diff-action": "none"
                      },
                      "children": [
                        {
                          "attributes": {},
                          "children": [],
                          "text": "Foo",
                          "type": "#text"
                        }
                      ],
                      "html": "<p data-diff-action=\"none\">Foo</p>",
                      "text": "Foo",
                      "type": "p"
                    }
                  ],
                  "html": "<li><p data-diff-action=\"none\">Foo</p></li>",
                  "text": "Foo",
                  "type": "li"
                }
              ],
              "html": "<ol start=\"1\"><li><p data-diff-action=\"none\">Foo</p></li></ol>",
              "text": "Foo",
              "type": "ol"
            },
            {
              "attributes": {
                "start": "2"
              },
              "children": [
                {
                  "attributes": {},
                  "children": [
                    {
                      "attributes": {},
                      "children": [],
                      "text": "Bar",
                      "type": "#text"
                    },
                    {
                      "attributes": {
                        "data-diff-action": "insert"
                      },
                      "children": [
                        {
                          "attributes": {},
                          "children": [],
                          "text": " ish",
                          "type": "#text"
                        }
                      ],
                      "html": "<ins data-diff-action=\"insert\"> ish</ins>",
                      "text": " ish",
                      "type": "ins"
                    }
                  ],
                  "html": "<li>Bar<ins data-diff-action=\"insert\"> ish</ins></li>",
                  "text": "Bar ish",
                  "type": "li"
                }
              ],
              "html": "<ol start=\"2\"><li>Bar<ins data-diff-action=\"insert\"> ish</ins></li></ol>",
              "text": "Bar ish",
              "type": "ol"
            },
            {
              "attributes": {
                "start": "3"
              },
              "children": [
                {
                  "attributes": {},
                  "children": [
                    {
                      "attributes": {
                        "data-diff-action": "none"
                      },
                      "children": [
                        {
                          "attributes": {},
                          "children": [],
                          "text": "Baz",
                          "type": "#text"
                        }
                      ],
                      "html": "<p data-diff-action=\"none\">Baz</p>",
                      "text": "Baz",
                      "type": "p"
                    }
                  ],
                  "html": "<li><p data-diff-action=\"none\">Baz</p></li>",
                  "text": "Baz",
                  "type": "li"
                }
              ],
              "html": "<ol start=\"3\"><li><p data-diff-action=\"none\">Baz</p></li></ol>",
              "text": "Baz",
              "type": "ol"
            }
          ],
          "html": "<div><ol start=\"1\"><li><p data-diff-action=\"none\">Foo</p></li></ol><ol start=\"2\"><li>Bar<ins data-diff-action=\"insert\"> ish</ins></li></ol><ol start=\"3\"><li><p data-diff-action=\"none\">Baz</p></li></ol></div>",
          "text": "FooBar ishBaz",
          "type": "div"
        }
      ],
      "html": "<div class=\"ve-ui-diffElement-document\"><div class=\"ve-ui-diffElement-spacer\">⋮</div><h2 data-diff-action=\"none\">Notes</h2><div><ol start=\"1\"><li><p data-diff-action=\"none\">Foo</p></li></ol><ol start=\"2\"><li>Bar<ins data-diff-action=\"insert\"> ish</ins></li></ol><ol start=\"3\"><li><p data-diff-action=\"none\">Baz</p></li></ol></div></div>",
      "text": "⋮NotesFooBar ishBaz",
      "type": "div"
    }
    Actual: {
      "attributes": {
        "class": "ve-ui-diffElement-document"
      },
      "children": [
        {
          "attributes": {
            "class": "ve-ui-diffElement-spacer"
          },
          "children": [
            {
              "attributes": {},
              "children": [],
              "text": "⋮",
              "type": "#text"
            }
          ],
          "html": "<div class=\"ve-ui-diffElement-spacer\">⋮</div>",
          "text": "⋮",
          "type": "div"
        },
        {
          "attributes": {
            "data-diff-action": "none"
          },
          "children": [
            {
              "attributes": {},
              "children": [],
              "text": "Notes",
              "type": "#text"
            }
          ],
          "html": "<h2 data-diff-action=\"none\">Notes</h2>",
          "text": "Notes",
          "type": "h2"
        },
        {
          "attributes": {},
          "children": [
            {
              "attributes": {
                "value": "1"
              },
              "children": [
                {
                  "attributes": {
                    "data-diff-action": "none"
                  },
                  "children": [
                    {
                      "attributes": {},
                      "children": [],
                      "text": "Foo",
                      "type": "#text"
                    }
                  ],
                  "html": "<p data-diff-action=\"none\">Foo</p>",
                  "text": "Foo",
                  "type": "p"
                }
              ],
              "html": "<li value=\"1\"><p data-diff-action=\"none\">Foo</p></li>",
              "text": "Foo",
              "type": "li"
            },
            {
              "attributes": {
                "value": "2"
              },
              "children": [
                {
                  "attributes": {},
                  "children": [],
                  "text": "Bar",
                  "type": "#text"
                },
                {
                  "attributes": {
                    "data-diff-action": "insert"
                  },
                  "children": [
                    {
                      "attributes": {},
                      "children": [],
                      "text": " ish",
                      "type": "#text"
                    }
                  ],
                  "html": "<ins data-diff-action=\"insert\"> ish</ins>",
                  "text": " ish",
                  "type": "ins"
                }
              ],
              "html": "<li value=\"2\">Bar<ins data-diff-action=\"insert\"> ish</ins></li>",
              "text": "Bar ish",
              "type": "li"
            },
            {
              "attributes": {
                "value": "3"
              },
              "children": [
                {
                  "attributes": {
                    "data-diff-action": "none"
                  },
                  "children": [
                    {
                      "attributes": {},
                      "children": [],
                      "text": "Baz",
                      "type": "#text"
                    }
                  ],
                  "html": "<p data-diff-action=\"none\">Baz</p>",
                  "text": "Baz",
                  "type": "p"
                }
              ],
              "html": "<li value=\"3\"><p data-diff-action=\"none\">Baz</p></li>",
              "text": "Baz",
              "type": "li"
            }
          ],
          "html": "<ol><li value=\"1\"><p data-diff-action=\"none\">Foo</p></li><li value=\"2\">Bar<ins data-diff-action=\"insert\"> ish</ins></li><li value=\"3\"><p data-diff-action=\"none\">Baz</p></li></ol>",
          "text": "FooBar ishBaz",
          "type": "ol"
        }
      ],
      "html": "<div class=\"ve-ui-diffElement-document\"><div class=\"ve-ui-diffElement-spacer\">⋮</div><h2 data-diff-action=\"none\">Notes</h2><ol><li value=\"1\"><p data-diff-action=\"none\">Foo</p></li><li value=\"2\">Bar<ins data-diff-action=\"insert\"> ish</ins></li><li value=\"3\"><p data-diff-action=\"none\">Baz</p></li></ol></div>",
      "text": "⋮NotesFooBar ishBaz",
      "type": "div"
    }
        at Object.ve.test.utils.runDiffElementTest

Event Timeline

Based on last two commits in mediawiki/extensions/VisualEditor, this one may be related:

New changes:
1da4a683b DiffElement/VisualDiff: Use node's root to determine the document model
950d56d09 DiffElement: Add core test for internal list diff
658a420a1 DiffElement: Simplify internal list rendering using list item value attribute

Bug: T198529

And I see from there that it is meant to be fixed by https://gerrit.wikimedia.org/r/c/mediawiki/extensions/Cite/+/755392.

Krinkle assigned this task to matmarex.
Krinkle added a project: Editing-team.

Which it is. Thanks :)

Sorry, I guess I should have force-merged the Cite patch too, I didn't expect it to take so long to get merged.

(Or I shouldn't have force-merged either, but then I'd have to do tedious back-and-forth changes to disable the affected tests before merging changes that'd affect them…)