@@ -2,9 +2,12 @@ import { Assertions } from '@ephox/agar';
22import '../alien/InitTestEnvironment' ;
33
44import { EditorComponent } from '../../../main/ts/public_api' ;
5- import { describe , it } from '@ephox/bedrock-client' ;
5+ import { beforeEach , describe , it } from '@ephox/bedrock-client' ;
66import { eachVersionContext , editorHook } from '../alien/TestHooks' ;
77import { Editor } from 'tinymce' ;
8+ import { ComponentFixture , TestBed } from '@angular/core/testing' ;
9+ import { FormsModule } from '@angular/forms' ;
10+ import { Component , ViewChild } from '@angular/core' ;
811
912describe ( 'DisabledPropertyTest' , ( ) => {
1013 const getMode = ( editor : Editor ) => {
@@ -104,4 +107,35 @@ describe('DisabledPropertyTest', () => {
104107 assertDesignMode ( editor ) ;
105108 } ) ;
106109 } ) ;
110+
111+ eachVersionContext ( [ '7' ] , ( ) => {
112+ @Component ( {
113+ imports : [ FormsModule , EditorComponent ] ,
114+ template : `<editor [(ngModel)]="text" [disabled]="true" />` ,
115+ standalone : true ,
116+ selector : 'test-host-component'
117+ } )
118+ class TestHostComponent {
119+ public text = '<h1>Hello World</h1>' ;
120+ @ViewChild ( EditorComponent ) public editorRef ! : EditorComponent ;
121+ }
122+
123+ let fixture : ComponentFixture < TestHostComponent > ;
124+ let testHost : TestHostComponent ;
125+
126+ beforeEach ( async ( ) => {
127+ await TestBed . configureTestingModule ( {
128+ imports : [ TestHostComponent ]
129+ } ) . compileComponents ( ) ;
130+
131+ fixture = TestBed . createComponent ( TestHostComponent ) ;
132+ testHost = fixture . componentInstance ;
133+ fixture . detectChanges ( ) ;
134+ } ) ;
135+
136+ it ( 'INT-3328: disabled property should work with [ngModel] when TinyMCE has been loaded before editor component has been created' , ( ) => {
137+ const tinyEditor = testHost . editorRef . editor ;
138+ assertDisabledOption ( tinyEditor ! , true ) ;
139+ } ) ;
140+ } ) ;
107141} ) ;
0 commit comments