Debian Codegraph @

extensions/VisualEditor/lib/ve/tests/ui/actions/ve.ui.WindowAction.test.js

raw symbols SCIP
1 /*!
2 * VisualEditor UserInterface Actions WindowAction tests.
3 *
4 * @copyright See AUTHORS.txt
5 */
6
7 QUnit.module( 've.ui.WindowAction' );
8
9 /* Tests */
10
11 QUnit.test( 'Basic open/close', ( assert ) => {
12 const surface = ve.test.utils.createSurfaceFromHtml( '' ),
13 windowAction = ve.ui.actionFactory.create( 'window', surface ),
14 dialogs = surface.getDialogs(),
15 done = assert.async( 2 );
16
17 dialogs.once( 'opening', ( win, opening ) => {
18 opening.then( () => {
19 assert.true( true, 'Window opened' );
20
21 windowAction.close( 'message' );
22 done();
23 } );
24 } );
25
26 dialogs.once( 'closing', () => {
27 assert.true( true, 'Window closed' );
28 done();
29 } );
30
31 windowAction.open( 'message' );
32 } );