Skip to content

Commit

Permalink
Merge pull request #996 from ckeditor/ck/epic/melman
Browse files Browse the repository at this point in the history
Internal: Added default license key to manual and automated tests.
  • Loading branch information
mmotyczynska authored Sep 6, 2024
2 parents f2b8130 + def11e0 commit 6252adf
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/ckeditor5-dev-tests/lib/tasks/runautomatedtests.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,9 @@ function createEntryFile( globPatterns, production ) {
throw new Error( 'Not found files to tests. Specified patterns are invalid.' );
}

// Set global license key in the `before` hook.
allFiles.unshift( path.join( __dirname, '..', 'utils', 'automated-tests', 'licensekeybefore.js' ).replace( /\\/g, '/' ) );

// Inject the leak detector root hooks. Need to be split into two parts due to #598.
allFiles.splice( 0, 0, path.join( __dirname, '..', 'utils', 'automated-tests', 'leaksdetectorbefore.js' ).replace( /\\/g, '/' ) );
allFiles.push( path.join( __dirname, '..', 'utils', 'automated-tests', 'leaksdetectorafter.js' ).replace( /\\/g, '/' ) );
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/**
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md.
*/

/* global window */

// eslint-disable-next-line mocha/no-top-level-hooks
before( function() {
window.CKEDITOR_GLOBAL_LICENSE_KEY = 'GPL';
} );
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ function compileHtmlFile( buildDir, options ) {
'<script src="/assets/websocket.js"></script>' +
'<script src="/assets/inspector.js"></script>' +
'<script src="/assets/attachinspector.js"></script>' +
'<script src="/assets/globallicensekey.js"></script>' +
`${ languagesToLoad.map( language => {
return `<script src="/translations/${ language }.js"></script>`;
} ).join( '' ) }` +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ const assets = [
path.join( __dirname, 'togglesidebar.js' ),
path.join( __dirname, 'attachinspector.js' ),
path.join( __dirname, 'websocket.js' ),
path.join( __dirname, 'globallicensekey.js' ),
require.resolve( '@ckeditor/ckeditor5-inspector' )
];

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/**
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md.
*/

/* global window */

window.CKEDITOR_GLOBAL_LICENSE_KEY = 'GPL';
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ describe( 'compileHtmlFiles', () => {
'<script src="/assets/websocket.js"></script>' +
'<script src="/assets/inspector.js"></script>' +
'<script src="/assets/attachinspector.js"></script>' +
'<script src="/assets/globallicensekey.js"></script>' +
'<script src="/path/to/manual/file.js"></script>' +
'</body>'
].join( '\n' )
Expand Down Expand Up @@ -207,6 +208,7 @@ describe( 'compileHtmlFiles', () => {
'<script src="/assets/websocket.js"></script>' +
'<script src="/assets/inspector.js"></script>' +
'<script src="/assets/attachinspector.js"></script>' +
'<script src="/assets/globallicensekey.js"></script>' +
'<script src="/translations/en.js"></script>' +
'<script src="/translations/pl.js"></script>' +
'<script src="/translations/ar.js"></script>' +
Expand Down Expand Up @@ -251,6 +253,7 @@ describe( 'compileHtmlFiles', () => {
'<script src="/assets/websocket.js"></script>' +
'<script src="/assets/inspector.js"></script>' +
'<script src="/assets/attachinspector.js"></script>' +
'<script src="/assets/globallicensekey.js"></script>' +
'<script src="/path/to/manual/file.abc.js"></script>' +
'</body>'
].join( '\n' )
Expand Down Expand Up @@ -324,6 +327,7 @@ describe( 'compileHtmlFiles', () => {
'<script src="/assets/websocket.js"></script>' +
'<script src="/assets/inspector.js"></script>' +
'<script src="/assets/attachinspector.js"></script>' +
'<script src="/assets/globallicensekey.js"></script>' +
'<script src="/path/to/manual/file.js"></script>' +
'</body>'
].join( '\n' )
Expand Down Expand Up @@ -404,6 +408,7 @@ describe( 'compileHtmlFiles', () => {
'<script src="/assets/websocket.js"></script>' +
'<script src="/assets/inspector.js"></script>' +
'<script src="/assets/attachinspector.js"></script>' +
'<script src="/assets/globallicensekey.js"></script>' +
'<script src="/path/to/manual/file.js"></script>' +
'</body>'
].join( '\n' )
Expand Down

0 comments on commit 6252adf

Please sign in to comment.