Ever since we added Wikibase to EntitySchema’s CI (T333661), Browser tests have been failing:
00:01:57.083 + expected - actual 00:01:57.083 00:01:57.084 -'content\t is \n\n\n here\n' 00:01:57.084 +'content\t is \n\n\n here' 00:01:57.084 00:01:57.084 at ViewSchemaPage.assertSchemaText (webpack:///./cypress/support/pageObjects/ViewSchemaPage.js:20:40) 00:01:57.084 at Context.eval (webpack:///./cypress/e2e/viewSchema.cy.js:16:17)
This is reproducible locally iff SyntaxHighlight_GeSHi is installed; it turns out that SyntaxHighlight_GeSHi is a indirect CI dependency of Wikibase (Wikibase → ArticlePlaceholder → Scribunto → SyntaxHighlight_GeSHi), and thus it’s now loaded in EntitySchema CI as well.
We are making use of syntax highlight ourselves in EntitySchemaSlotViewRenderer. That was added for T238831: Syntax highlighting for viewing ShExC code (EntitySchema pages).
Having a look at the database, it is clear that this is only a visual change when viewing the EntitySchema content. It is not in the database and it is also not present when editing the content.
Possible ways to maybe fix this:
- understand how/why/where SyntaxHighlight is adding those newlines and fix it there
- trim those newlines in our browser tests
- expect those newlines in our browser tests
- add the newlines to our input data in tests
- somehow disable SyntaxHighlight in our browser tests