2024-01-30 13:37:11 +00:00
|
|
|
import * as helpers from './../../utils/functions.helper.js';
|
2024-03-14 12:47:21 +00:00
|
|
|
const title = helpers.getTestString( 'CiteTest-title' );
|
2024-01-30 13:37:11 +00:00
|
|
|
|
2024-03-15 18:15:57 +00:00
|
|
|
const refText1 = 'This is citation #1 for reference #1 and #2';
|
|
|
|
const wikiText = `This is reference #1: <ref name="a">${ refText1 }</ref><br> ` +
|
|
|
|
'This is reference #2 <ref name="a" /><br>' +
|
|
|
|
'<references />';
|
|
|
|
|
2024-01-30 13:37:11 +00:00
|
|
|
describe( 'Visual Editor Cite Integration', () => {
|
|
|
|
before( () => {
|
|
|
|
cy.visit( '/index.php' );
|
2024-03-15 18:15:57 +00:00
|
|
|
helpers.editPage( title, wikiText );
|
|
|
|
} );
|
2024-01-30 13:37:11 +00:00
|
|
|
|
2024-03-15 18:15:57 +00:00
|
|
|
beforeEach( () => {
|
|
|
|
helpers.visitTitle( title );
|
2024-01-30 13:37:11 +00:00
|
|
|
|
|
|
|
cy.window().then( async ( win ) => {
|
2024-03-14 12:47:21 +00:00
|
|
|
win.localStorage.setItem( 've-beta-welcome-dialog', 1 );
|
2024-01-30 13:37:11 +00:00
|
|
|
} );
|
|
|
|
|
2024-03-14 12:47:21 +00:00
|
|
|
helpers.visitTitle( title, { veaction: 'edit' } );
|
2024-03-15 18:15:57 +00:00
|
|
|
} );
|
2024-01-30 13:37:11 +00:00
|
|
|
|
2024-03-15 18:15:57 +00:00
|
|
|
it( 'should edit and verify reference content in Visual Editor', () => {
|
2024-01-30 13:37:11 +00:00
|
|
|
helpers.getVEFootnoteMarker( 'a', 1, 1 ).click();
|
2024-03-15 18:15:57 +00:00
|
|
|
|
2024-01-30 13:37:11 +00:00
|
|
|
// Popup appears containing ref content
|
|
|
|
helpers.getVEReferencePopup()
|
|
|
|
.should( 'be.visible' )
|
2024-03-15 18:15:57 +00:00
|
|
|
.should( 'contain.text', refText1 );
|
2024-01-30 13:37:11 +00:00
|
|
|
|
|
|
|
// Open edit popup
|
|
|
|
cy.contains( '.oo-ui-buttonElement-button', 'Edit' ).click();
|
|
|
|
|
|
|
|
// Dialog appears with ref content
|
|
|
|
helpers.getVEDialog()
|
|
|
|
.should( 'be.visible' )
|
2024-03-15 18:15:57 +00:00
|
|
|
.should( 'contain.text', refText1 );
|
2024-01-30 13:37:11 +00:00
|
|
|
} );
|
|
|
|
|
|
|
|
} );
|