[Cypress] Always provide ref templates to fix Citoid

The Citoid dialog won't be available when the .json configuration
is missing. That's why test always failed here when triggered
from the Citoid CI.

Bug: T366383
Change-Id: I88ad478250328896c504ccbc95a973d4a0100dd7
This commit is contained in:
WMDE-Fisch 2024-06-26 09:11:43 +02:00
parent 5fcc9dab86
commit af3f14d430

View file

@ -1,4 +1,3 @@
require( '@cypress/skip-test/support' );
import * as helper from './../../utils/functions.helper.js';
import * as veHelper from './../../utils/ve.helper.js';
@ -13,6 +12,25 @@ const wikiText = `This is reference #1: <ref name="a">${ refText1 }</ref><br> `
let usesCitoid;
describe( 'Re-using refs in Visual Editor', () => {
before( () => {
cy.clearCookies();
helper.loginAsAdmin();
helper.editPage( 'MediaWiki:Cite-tool-definition.json', JSON.stringify( [
{
name: 'Webseite',
icon: 'ref-cite-web',
template: 'Internetquelle'
},
{
name: 'Literatur',
icon: 'ref-cite-book',
template: 'Literatur'
}
] ) );
} );
beforeEach( () => {
const title = helper.getTestString( 'CiteTest-reuseRefs' );
@ -28,9 +46,6 @@ describe( 'Re-using refs in Visual Editor', () => {
} );
it( 'should display re-used reference in article with correct footnote number and notification in context dialog', () => {
// TODO: Renable test with Citoid when they're stable in CI
cy.skipOn( usesCitoid );
// Currently there are 3 refs in the article
helper.getRefsFromArticleSection().should( 'have.length', 3 );
@ -74,9 +89,6 @@ describe( 'Re-using refs in Visual Editor', () => {
} );
it( 'should display correct ref content and name attribute for re-used ref with existing name attribute', () => {
// TODO: Renable test with Citoid when they're stable in CI
cy.skipOn( usesCitoid );
// Place cursor next to ref #1 in order to add re-used ref next to it
cy.contains( '.mw-reflink-text', '[1]' ).first().type( '{rightarrow}' );