@@ -209,95 +209,95 @@ describe('[HDSD] HDSSettings dynamic settings', function () {
209209 } ) ;
210210
211211 it ( '[HDSD1] _testInject and get work for dynamic keys' , ( ) => {
212- HDSSettings . _testInject ( 'converter-auto -wellbeing-mood' , 'billings' ) ;
213- assert . strictEqual ( HDSSettings . get ( 'converter-auto -wellbeing-mood' ) , 'billings' ) ;
212+ HDSSettings . _testInject ( 'preferred-display -wellbeing-mood' , 'billings' ) ;
213+ assert . strictEqual ( HDSSettings . get ( 'preferred-display -wellbeing-mood' ) , 'billings' ) ;
214214 assert . strictEqual ( HDSSettings . isHooked , true ) ;
215215 } ) ;
216216
217217 it ( '[HDSD2] _testClear removes dynamic key' , ( ) => {
218- HDSSettings . _testInject ( 'converter-auto -wellbeing-mood' , 'mira' ) ;
219- HDSSettings . _testClear ( 'converter-auto -wellbeing-mood' ) ;
220- assert . strictEqual ( HDSSettings . get ( 'converter-auto -wellbeing-mood' ) , undefined ) ;
218+ HDSSettings . _testInject ( 'preferred-display -wellbeing-mood' , 'mira' ) ;
219+ HDSSettings . _testClear ( 'preferred-display -wellbeing-mood' ) ;
220+ assert . strictEqual ( HDSSettings . get ( 'preferred-display -wellbeing-mood' ) , undefined ) ;
221221 } ) ;
222222
223223 it ( '[HDSD3] getDynamic returns all settings with prefix' , ( ) => {
224- HDSSettings . _testInject ( 'converter-auto -wellbeing-mood' , 'billings' ) ;
225- HDSSettings . _testInject ( 'converter-auto -body-vulva-mucus-inspect' , 'appleHealth' ) ;
226- const all = HDSSettings . getDynamic ( 'converter-auto -' ) ;
224+ HDSSettings . _testInject ( 'preferred-display -wellbeing-mood' , 'billings' ) ;
225+ HDSSettings . _testInject ( 'preferred-display -body-vulva-mucus-inspect' , 'appleHealth' ) ;
226+ const all = HDSSettings . getDynamic ( 'preferred-display -' ) ;
227227 assert . strictEqual ( all [ 'wellbeing-mood' ] , 'billings' ) ;
228228 assert . strictEqual ( all [ 'body-vulva-mucus-inspect' ] , 'appleHealth' ) ;
229229 } ) ;
230230
231231 it ( '[HDSD4] unhook clears dynamic settings' , ( ) => {
232- HDSSettings . _testInject ( 'converter-auto -wellbeing-mood' , 'billings' ) ;
232+ HDSSettings . _testInject ( 'preferred-display -wellbeing-mood' , 'billings' ) ;
233233 HDSSettings . unhook ( ) ;
234- assert . strictEqual ( HDSSettings . get ( 'converter-auto -wellbeing-mood' ) , undefined ) ;
235- assert . deepStrictEqual ( HDSSettings . getDynamic ( 'converter-auto -' ) , { } ) ;
234+ assert . strictEqual ( HDSSettings . get ( 'preferred-display -wellbeing-mood' ) , undefined ) ;
235+ assert . deepStrictEqual ( HDSSettings . getDynamic ( 'preferred-display -' ) , { } ) ;
236236 } ) ;
237237
238238 it ( '[HDSD5] load reads dynamic settings from server events' , async ( ) => {
239239 const conn = createMockConnection ( {
240240 'events.get' : ( ) => ( {
241241 events : [
242- { id : 'ev-ac1' , type : 'settings/converter-auto ' , content : { itemKey : 'wellbeing-mood' , method : 'billings' } } ,
243- { id : 'ev-ac2' , type : 'settings/converter-auto ' , content : { itemKey : 'body-vulva-mucus-inspect' , method : 'appleHealth' } } ,
242+ { id : 'ev-ac1' , type : 'settings/preferred-display ' , content : { itemKey : 'wellbeing-mood' , value : 'billings' } } ,
243+ { id : 'ev-ac2' , type : 'settings/preferred-display ' , content : { itemKey : 'body-vulva-mucus-inspect' , value : 'appleHealth' } } ,
244244 { id : 'ev-t' , type : 'settings/theme' , content : 'dark' } ,
245245 ]
246246 } )
247247 } ) ;
248248 await HDSSettings . hookToConnection ( conn , 'test-stream' ) ;
249- assert . strictEqual ( HDSSettings . get ( 'converter-auto -wellbeing-mood' ) , 'billings' ) ;
250- assert . strictEqual ( HDSSettings . get ( 'converter-auto -body-vulva-mucus-inspect' ) , 'appleHealth' ) ;
249+ assert . strictEqual ( HDSSettings . get ( 'preferred-display -wellbeing-mood' ) , 'billings' ) ;
250+ assert . strictEqual ( HDSSettings . get ( 'preferred-display -body-vulva-mucus-inspect' ) , 'appleHealth' ) ;
251251 assert . strictEqual ( HDSSettings . get ( 'theme' ) , 'dark' ) ;
252252 } ) ;
253253
254254 it ( '[HDSD6] setDynamic creates new event' , async ( ) => {
255255 const conn = createMockConnection ( ) ;
256256 await HDSSettings . hookToConnection ( conn , 'test-stream' ) ;
257257
258- await HDSSettings . setDynamic ( 'converter-auto -wellbeing-mood' , 'billings' ) ;
259- assert . strictEqual ( HDSSettings . get ( 'converter-auto -wellbeing-mood' ) , 'billings' ) ;
258+ await HDSSettings . setDynamic ( 'preferred-display -wellbeing-mood' , 'billings' ) ;
259+ assert . strictEqual ( HDSSettings . get ( 'preferred-display -wellbeing-mood' ) , 'billings' ) ;
260260
261261 const createCall = conn . apiCalls . find ( c =>
262- c . method === 'events.create' && c . params . type === 'settings/converter-auto '
262+ c . method === 'events.create' && c . params . type === 'settings/preferred-display '
263263 ) ;
264264 assert . ok ( createCall , 'Should have called events.create' ) ;
265265 assert . strictEqual ( createCall . params . content . itemKey , 'wellbeing-mood' ) ;
266- assert . strictEqual ( createCall . params . content . method , 'billings' ) ;
266+ assert . strictEqual ( createCall . params . content . value , 'billings' ) ;
267267 } ) ;
268268
269269 it ( '[HDSD7] setDynamic updates existing event' , async ( ) => {
270270 const conn = createMockConnection ( {
271271 'events.get' : ( ) => ( {
272272 events : [
273- { id : 'ev-ac-mood' , type : 'settings/converter-auto ' , content : { itemKey : 'wellbeing-mood' , method : 'billings' } }
273+ { id : 'ev-ac-mood' , type : 'settings/preferred-display ' , content : { itemKey : 'wellbeing-mood' , value : 'billings' } }
274274 ]
275275 } )
276276 } ) ;
277277 await HDSSettings . hookToConnection ( conn , 'test-stream' ) ;
278- assert . strictEqual ( HDSSettings . get ( 'converter-auto -wellbeing-mood' ) , 'billings' ) ;
278+ assert . strictEqual ( HDSSettings . get ( 'preferred-display -wellbeing-mood' ) , 'billings' ) ;
279279
280- await HDSSettings . setDynamic ( 'converter-auto -wellbeing-mood' , 'mira' ) ;
281- assert . strictEqual ( HDSSettings . get ( 'converter-auto -wellbeing-mood' ) , 'mira' ) ;
280+ await HDSSettings . setDynamic ( 'preferred-display -wellbeing-mood' , 'mira' ) ;
281+ assert . strictEqual ( HDSSettings . get ( 'preferred-display -wellbeing-mood' ) , 'mira' ) ;
282282
283283 const updateCall = conn . apiCalls . find ( c => c . method === 'events.update' ) ;
284284 assert . ok ( updateCall , 'Should have called events.update' ) ;
285285 assert . strictEqual ( updateCall . params . id , 'ev-ac-mood' ) ;
286- assert . strictEqual ( updateCall . params . update . content . method , 'mira' ) ;
286+ assert . strictEqual ( updateCall . params . update . content . value , 'mira' ) ;
287287 } ) ;
288288
289289 it ( '[HDSD8] setDynamic with null deletes setting' , async ( ) => {
290290 const conn = createMockConnection ( {
291291 'events.get' : ( ) => ( {
292292 events : [
293- { id : 'ev-ac-mood' , type : 'settings/converter-auto ' , content : { itemKey : 'wellbeing-mood' , method : 'billings' } }
293+ { id : 'ev-ac-mood' , type : 'settings/preferred-display ' , content : { itemKey : 'wellbeing-mood' , value : 'billings' } }
294294 ]
295295 } )
296296 } ) ;
297297 await HDSSettings . hookToConnection ( conn , 'test-stream' ) ;
298298
299- await HDSSettings . setDynamic ( 'converter-auto -wellbeing-mood' , null ) ;
300- assert . strictEqual ( HDSSettings . get ( 'converter-auto -wellbeing-mood' ) , undefined ) ;
299+ await HDSSettings . setDynamic ( 'preferred-display -wellbeing-mood' , null ) ;
300+ assert . strictEqual ( HDSSettings . get ( 'preferred-display -wellbeing-mood' ) , undefined ) ;
301301
302302 const deleteCall = conn . apiCalls . find ( c => c . method === 'events.delete' ) ;
303303 assert . ok ( deleteCall , 'Should have called events.delete' ) ;
@@ -315,7 +315,7 @@ describe('[HDSD] HDSSettings dynamic settings', function () {
315315
316316 it ( '[HDSD10] setDynamic throws when not hooked' , async ( ) => {
317317 await assert . rejects (
318- ( ) => HDSSettings . setDynamic ( 'converter-auto -wellbeing-mood' , 'billings' ) ,
318+ ( ) => HDSSettings . setDynamic ( 'preferred-display -wellbeing-mood' , 'billings' ) ,
319319 / h o o k T o A p p l i c a t i o n | h o o k T o C o n n e c t i o n /
320320 ) ;
321321 } ) ;
0 commit comments