@@ -23,15 +23,15 @@ describe('DisabledPropertyTest', () => {
2323 const assertDisabledOption = ( editor : Editor , expected : boolean ) =>
2424 Assertions . assertEq ( `TinyMCE should have disabled option set to ${ expected } ` , expected , editor . options . get ( 'disabled' ) ) ;
2525
26- eachVersionContext ( [ '7.5.0' ] , ( ) => {
26+ eachVersionContext ( [ '5' , '6' , ' 7.5.0', ] , ( ) => {
2727 const createFixture = editorHook ( EditorComponent ) ;
2828
29- it ( `Component 'disabled' property is mapped to editor 'readonly' property ` , async ( ) => {
29+ it ( `Component 'disabled' property is mapped to editor 'readonly' mode ` , async ( ) => {
3030 const { editor } = await createFixture ( { disabled : true } ) ;
3131 assertReadonlyMode ( editor ) ;
3232 } ) ;
3333
34- it ( `Toggling component's 'disabled' property is mapped to editor 'readonly' property ` , async ( ) => {
34+ it ( `Toggling component's 'disabled' property is mapped to editor 'readonly' mode ` , async ( ) => {
3535 const fixture = await createFixture ( ) ;
3636 const { editor } = fixture ;
3737
@@ -46,6 +46,26 @@ describe('DisabledPropertyTest', () => {
4646 assertDesignMode ( editor ) ;
4747 } ) ;
4848
49+ it ( `Setting the 'readonly' property causing readonly mode` , async ( ) => {
50+ const { editor } = await createFixture ( { readonly : true } ) ;
51+ assertReadonlyMode ( editor ) ;
52+ } ) ;
53+
54+ it ( `Toggling component's 'readonly' property is mapped to editor 'readonly' mode` , async ( ) => {
55+ const fixture = await createFixture ( ) ;
56+ const { editor } = fixture ;
57+
58+ assertDesignMode ( editor ) ;
59+
60+ fixture . componentRef . setInput ( 'readonly' , true ) ;
61+ fixture . detectChanges ( ) ;
62+ assertReadonlyMode ( editor ) ;
63+
64+ fixture . componentRef . setInput ( 'readonly' , false ) ;
65+ fixture . detectChanges ( ) ;
66+ assertDesignMode ( editor ) ;
67+ } ) ;
68+
4969 it ( `[disabled]=true [readonly]=false triggers readonly mode` , async ( ) => {
5070 const { editor } = await createFixture ( { disabled : true , readonly : false } ) ;
5171 assertReadonlyMode ( editor ) ;
@@ -67,7 +87,7 @@ describe('DisabledPropertyTest', () => {
6787 assertDesignMode ( editor ) ;
6888 } ) ;
6989
70- it ( `Toggling component's 'disabled' property is mapped to editor 'disabled' property ` , async ( ) => {
90+ it ( `Toggling component's 'disabled' property is mapped to editor 'disabled' option ` , async ( ) => {
7191 const fixture = await createFixture ( ) ;
7292 const { editor } = fixture ;
7393
@@ -86,30 +106,6 @@ describe('DisabledPropertyTest', () => {
86106 } ) ;
87107 } ) ;
88108
89- eachVersionContext ( [ '4' , '5' , '6' , '7' ] , ( ) => {
90- const createFixture = editorHook ( EditorComponent ) ;
91-
92- it ( `Setting the 'readonly' property causing readonly mode` , async ( ) => {
93- const { editor } = await createFixture ( { readonly : true } ) ;
94- assertReadonlyMode ( editor ) ;
95- } ) ;
96-
97- it ( `Toggling component's 'readonly' property is mapped to editor 'readonly' mode` , async ( ) => {
98- const fixture = await createFixture ( ) ;
99- const { editor } = fixture ;
100-
101- assertDesignMode ( editor ) ;
102-
103- fixture . componentRef . setInput ( 'readonly' , true ) ;
104- fixture . detectChanges ( ) ;
105- assertReadonlyMode ( editor ) ;
106-
107- fixture . componentRef . setInput ( 'readonly' , false ) ;
108- fixture . detectChanges ( ) ;
109- assertDesignMode ( editor ) ;
110- } ) ;
111- } ) ;
112-
113109 context ( 'With version 7' , ( ) => {
114110 @Component ( {
115111 imports : [ FormsModule , EditorComponent ] ,
0 commit comments