@@ -49,14 +49,14 @@ describe('LiveController query string binding', () => {
49
49
// String
50
50
51
51
// Set value
52
- test . expectsAjaxCall ( ) . expectUpdatedData ( { prop1 : 'foo' } ) ;
52
+ test . expectsAjaxCall ( ) . expectUpdatedData ( { prop1 : 'foo' } ) . willReturnLiveUrl ( '?prop1=foo&prop2=' ) ;
53
53
54
54
await test . component . set ( 'prop1' , 'foo' , true ) ;
55
55
56
56
expectCurrentSearch ( ) . toEqual ( '?prop1=foo&prop2=' ) ;
57
57
58
58
// Remove value
59
- test . expectsAjaxCall ( ) . expectUpdatedData ( { prop1 : '' } ) ;
59
+ test . expectsAjaxCall ( ) . expectUpdatedData ( { prop1 : '' } ) . willReturnLiveUrl ( '?prop1=&prop2=' ) ;
60
60
61
61
await test . component . set ( 'prop1' , '' , true ) ;
62
62
@@ -65,14 +65,14 @@ describe('LiveController query string binding', () => {
65
65
// Number
66
66
67
67
// Set value
68
- test . expectsAjaxCall ( ) . expectUpdatedData ( { prop2 : 42 } ) ;
68
+ test . expectsAjaxCall ( ) . expectUpdatedData ( { prop2 : 42 } ) . willReturnLiveUrl ( '?prop1=&prop2=42' ) ;
69
69
70
70
await test . component . set ( 'prop2' , 42 , true ) ;
71
71
72
72
expectCurrentSearch ( ) . toEqual ( '?prop1=&prop2=42' ) ;
73
73
74
74
// Remove value
75
- test . expectsAjaxCall ( ) . expectUpdatedData ( { prop2 : null } ) ;
75
+ test . expectsAjaxCall ( ) . expectUpdatedData ( { prop2 : null } ) . willReturnLiveUrl ( '?prop1=&prop2=' ) ;
76
76
77
77
await test . component . set ( 'prop2' , null , true ) ;
78
78
@@ -88,21 +88,21 @@ describe('LiveController query string binding', () => {
88
88
) ;
89
89
90
90
// Set value
91
- test . expectsAjaxCall ( ) . expectUpdatedData ( { prop : [ 'foo' , 'bar' ] } ) ;
91
+ test . expectsAjaxCall ( ) . expectUpdatedData ( { prop : [ 'foo' , 'bar' ] } ) . willReturnLiveUrl ( '?prop[0]=foo&prop[1]=bar' ) ;
92
92
93
93
await test . component . set ( 'prop' , [ 'foo' , 'bar' ] , true ) ;
94
94
95
95
expectCurrentSearch ( ) . toEqual ( '?prop[0]=foo&prop[1]=bar' ) ;
96
96
97
97
// Remove one value
98
- test . expectsAjaxCall ( ) . expectUpdatedData ( { prop : [ 'foo' ] } ) ;
98
+ test . expectsAjaxCall ( ) . expectUpdatedData ( { prop : [ 'foo' ] } ) . willReturnLiveUrl ( '?prop[0]=foo' ) ;
99
99
100
100
await test . component . set ( 'prop' , [ 'foo' ] , true ) ;
101
101
102
102
expectCurrentSearch ( ) . toEqual ( '?prop[0]=foo' ) ;
103
103
104
104
// Remove all remaining values
105
- test . expectsAjaxCall ( ) . expectUpdatedData ( { prop : [ ] } ) ;
105
+ test . expectsAjaxCall ( ) . expectUpdatedData ( { prop : [ ] } ) . willReturnLiveUrl ( '?prop=' ) ;
106
106
107
107
await test . component . set ( 'prop' , [ ] , true ) ;
108
108
@@ -118,28 +118,28 @@ describe('LiveController query string binding', () => {
118
118
) ;
119
119
120
120
// Set single nested prop
121
- test . expectsAjaxCall ( ) . expectUpdatedData ( { 'prop.foo' : 'dummy' } ) ;
121
+ test . expectsAjaxCall ( ) . expectUpdatedData ( { 'prop.foo' : 'dummy' } ) . willReturnLiveUrl ( '?prop[foo]=dummy' ) ;
122
122
123
123
await test . component . set ( 'prop.foo' , 'dummy' , true ) ;
124
124
125
125
expectCurrentSearch ( ) . toEqual ( '?prop[foo]=dummy' ) ;
126
126
127
127
// Set multiple values
128
- test . expectsAjaxCall ( ) . expectUpdatedData ( { prop : { foo : 'other' , bar : 42 } } ) ;
128
+ test . expectsAjaxCall ( ) . expectUpdatedData ( { prop : { foo : 'other' , bar : 42 } } ) . willReturnLiveUrl ( '?prop[foo]=other&prop[bar]=42' ) ;
129
129
130
130
await test . component . set ( 'prop' , { foo : 'other' , bar : 42 } , true ) ;
131
131
132
132
expectCurrentSearch ( ) . toEqual ( '?prop[foo]=other&prop[bar]=42' ) ;
133
133
134
134
// Remove one value
135
- test . expectsAjaxCall ( ) . expectUpdatedData ( { prop : { foo : 'other' , bar : null } } ) ;
135
+ test . expectsAjaxCall ( ) . expectUpdatedData ( { prop : { foo : 'other' , bar : null } } ) . willReturnLiveUrl ( '?prop[foo]=other' ) ;
136
136
137
137
await test . component . set ( 'prop' , { foo : 'other' , bar : null } , true ) ;
138
138
139
139
expectCurrentSearch ( ) . toEqual ( '?prop[foo]=other' ) ;
140
140
141
141
// Remove all values
142
- test . expectsAjaxCall ( ) . expectUpdatedData ( { prop : { foo : null , bar : null } } ) ;
142
+ test . expectsAjaxCall ( ) . expectUpdatedData ( { prop : { foo : null , bar : null } } ) . willReturnLiveUrl ( '?prop=' ) ;
143
143
144
144
await test . component . set ( 'prop' , { foo : null , bar : null } , true ) ;
145
145
@@ -161,7 +161,8 @@ describe('LiveController query string binding', () => {
161
161
. expectActionCalled ( 'changeProp' )
162
162
. serverWillChangeProps ( ( data : any ) => {
163
163
data . prop = 'foo' ;
164
- } ) ;
164
+ } )
165
+ . willReturnLiveUrl ( '?prop=foo' ) ;
165
166
166
167
getByText ( test . element , 'Change prop' ) . click ( ) ;
167
168
@@ -179,14 +180,14 @@ describe('LiveController query string binding', () => {
179
180
) ;
180
181
181
182
// Set value
182
- test . expectsAjaxCall ( ) . expectUpdatedData ( { prop1 : 'foo' } ) ;
183
+ test . expectsAjaxCall ( ) . expectUpdatedData ( { prop1 : 'foo' } ) . willReturnLiveUrl ( '?alias1=foo' ) ;
183
184
184
185
await test . component . set ( 'prop1' , 'foo' , true ) ;
185
186
186
187
expectCurrentSearch ( ) . toEqual ( '?alias1=foo' ) ;
187
188
188
189
// Remove value
189
- test . expectsAjaxCall ( ) . expectUpdatedData ( { prop1 : '' } ) ;
190
+ test . expectsAjaxCall ( ) . expectUpdatedData ( { prop1 : '' } ) . willReturnLiveUrl ( '?alias1=' ) ;
190
191
191
192
await test . component . set ( 'prop1' , '' , true ) ;
192
193
0 commit comments