@@ -10,6 +10,8 @@ it('should get names of components', () => {
1010} )
1111
1212it ( 'should create globals + add annotation for each component' , ( ) => {
13+ cy . visit ( '/' ) . get ( '[data-testid=component-name]' ) . should ( 'be.visible' )
14+
1315 let win
1416 cy . frameLoaded ( '#target' ) . then ( ( ) => {
1517 win = cy . $$ ( '#target' ) . get ( 0 ) . contentWindow
@@ -69,8 +71,7 @@ it('should handle replacing a component and keep its listed position', () => {
6971it ( 'should add/remove hover overlay on component mouseenter/leave' , ( ) => {
7072 cy . visit ( '/' )
7173 // check overlay works for first component
72- cy . get ( '[data-testid=component-container]' ) . first ( ) . should ( 'be.visible' )
73- cy . get ( '[data-testid=component-container]' ) . first ( ) . trigger ( 'mouseenter' )
74+ cy . get ( '[data-testid=component-container]' ) . first ( ) . should ( 'be.visible' ) . trigger ( 'mouseenter' )
7475
7576 cy . iframe ( '#target' ) . find ( '[data-testid=hover-element]' ) . should ( 'be.visible' )
7677
@@ -100,7 +101,6 @@ it('should add/remove hover overlay on component mouseenter/leave', () => {
100101 cy . get ( '[data-testid=component-container]' ) . last ( ) . trigger ( 'mouseleave' )
101102
102103 cy . iframe ( '#target' ) . find ( '[data-testid=hover-element]' ) . should ( 'not.exist' )
103- cy . get ( '[data-testid=component-container]' ) . last ( ) . should ( 'be.visible' )
104104
105105 cy . get ( '[data-testid=component-container]' ) . last ( ) . trigger ( 'mouseenter' )
106106
@@ -119,8 +119,6 @@ it('should add/remove hover overlay on component mouseenter/leave', () => {
119119 cy . iframe ( '#target' ) . find ( '[data-testid=hover-element]' ) . should ( 'not.exist' )
120120
121121 // check overlay disappears on `shutdown`
122- cy . get ( '[data-testid=component-container]' ) . first ( ) . should ( 'be.visible' )
123-
124122 cy . get ( '[data-testid=component-container]' ) . first ( ) . trigger ( 'mouseenter' )
125123
126124 cy . iframe ( '#target' ) . find ( '[data-testid=hover-element]' ) . should ( 'be.visible' )
@@ -146,7 +144,11 @@ it('should support selecting/unselecting a component', () => {
146144 cy . get ( '[data-testid=component-container]' ) . last ( ) . should ( 'not.have.class' , 'text-white bg-alpine-300' )
147145} )
148146
149- it ( 'should display read-only function/HTMLElement attributes' , ( ) => {
147+ it ( 'should display read-only function/HTMLElement attributes + allow editing of booleans, numbers and strings' , ( ) => {
148+ cy . visit ( '/' ) . get ( '[data-testid=component-name]' ) . should ( 'be.visible' )
149+
150+ cy . get ( '[data-testid=component-container]' ) . first ( ) . click ( )
151+
150152 cy . get ( '[data-testid=data-property-name-myFunction]' ) . should ( 'be.visible' ) . contains ( 'myFunction' )
151153
152154 cy . get ( '[data-testid=data-property-value-myFunction]' ) . should ( 'contain.text' , 'function' )
@@ -172,9 +174,7 @@ it('should display read-only function/HTMLElement attributes', () => {
172174
173175 cy . get ( '[data-testid=data-property-name-attributes]' ) . should ( 'not.be.visible' )
174176 cy . get ( '[data-testid=data-property-name-children]' ) . should ( 'not.be.visible' )
175- } )
176177
177- it ( 'should allow editing of booleans, numbers and strings' , ( ) => {
178178 // booleans
179179 cy . get ( '[data-testid=data-property-name-bool]' ) . should ( 'be.visible' ) . contains ( 'bool' )
180180 cy . get ( '[data-testid=data-property-value-bool]' ) . should ( 'contain.text' , 'true' )
@@ -219,6 +219,25 @@ it('should allow editing of booleans, numbers and strings', () => {
219219 cy . iframe ( '#target' ) . contains ( 'Str, type: "string", value: "devtools"' )
220220} )
221221
222+ it ( 'should support x-model updates (even without a re-render) and editing values' , ( ) => {
223+ cy . visit ( '/' ) . get ( '[data-testid=component-name]' ) . should ( 'be.visible' )
224+
225+ cy . get ( '[data-testid=component-name]' ) . contains ( 'model-no-render' ) . click ( ) . trigger ( 'mouseleave' )
226+ cy . get ( '[data-testid=data-property-name-text]' ) . should ( 'be.visible' ) . contains ( 'text' )
227+ cy . get ( '[data-testid=data-property-value-text]' ) . should ( 'be.visible' ) . contains ( 'initial' )
228+ cy . iframe ( '#target' ) . find ( '[data-testid=model-no-render]' ) . should ( 'be.visible' ) . clear ( ) . type ( 'updated' )
229+ cy . get ( '[data-testid=data-property-value-text]' ) . should ( 'be.visible' ) . contains ( 'updated' )
230+
231+ cy . get ( '[data-testid=edit-icon-text]' ) . click ( { force : true } )
232+ cy . get ( '[data-testid=input-text]' )
233+ . clear ( { force : true } )
234+ . type ( 'from-devtools' , { force : true } )
235+ . siblings ( '[data-testid=save-icon]' )
236+ . click ( { force : true } )
237+
238+ cy . iframe ( '#target' ) . find ( '[data-testid=model-no-render]' ) . should ( 'have.value' , 'from-devtools' )
239+ } )
240+
222241it ( 'should display message with number of components watched' , ( ) => {
223242 cy . visit ( '/' )
224243 . get ( '[data-testid=component-name]' )
0 commit comments