/** * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */ import ModelTestEditor from '@ckeditor/ckeditor5-core/tests/_utils/modeltesteditor'; import ImageTextAlternativeCommand from '../../src/imagetextalternative/imagetextalternativecommand'; import { setData, getData } from '@ckeditor/ckeditor5-engine/src/dev-utils/model'; describe( 'ImageTextAlternativeCommand', () => { let model, command; beforeEach( () => { return ModelTestEditor.create() .then( newEditor => { model = newEditor.model; command = new ImageTextAlternativeCommand( newEditor ); model.schema.registerItem( 'p', '$block' ); model.schema.registerItem( 'image' ); model.schema.requireAttributes( 'image', [ 'src' ] ); model.schema.allow( { name: 'image', attributes: [ 'alt', 'src' ], inside: '$root' } ); model.schema.objects.add( 'image' ); } ); } ); it( 'should have false value if no image is selected', () => { setData( model, '[]
' ); expect( command.value ).to.be.false; } ); it( 'should have false value if image without alt is selected', () => { setData( model, '[