11/*
2- * Copyright (c) 2010, 2025 BSI Business Systems Integration AG
2+ * Copyright (c) 2010, 2026 BSI Business Systems Integration AG
33 *
44 * This program and the accompanying materials are made
55 * available under the terms of the Eclipse Public License 2.0
99 */
1010
1111import {
12- ActivateBookmarkPathParam , BaseDoEntity , BookmarkDo , BookmarkDoBuilder , BookmarkSupport , BookmarkTableRowIdentifierDo , BookmarkTableRowIdentifierStringComponentDo , BooleanColumn , Column , Desktop , NodeBookmarkPageDo , NumberColumn ,
12+ ActivateBookmarkPathParam , BaseDoEntity , BookmarkDo , BookmarkDoBuilder , BookmarkSupport , BookmarkTableRowIdentifierDo , BookmarkTableRowIdentifierStringComponentDo , BooleanColumn , Column , dates , Desktop , NodeBookmarkPageDo , NumberColumn ,
1313 NumberColumnUserFilter , NumberColumnUserFilterStateDo , Outline , OutlineBookmarkDefinitionDo , PageBookmarkDefinitionDo , PageIdDummyPageParamDo , ResetMenu , scout , SearchMenu , Table , TableBookmarkPageDo , TableClientUiPreferenceProfileDo ,
1414 TableClientUiPreferencesDo , TableColumnClientUiPreferenceDo , TableTextUserFilter , TableTextUserFilterStateDo , TableUiPreferences , UuidPool
1515} from '../../src/index' ;
@@ -33,6 +33,9 @@ describe('BookmarkSupport', () => {
3333 } ) ;
3434 desktop = session . desktop ;
3535 bookmarkSupport = BookmarkSupport . get ( session ) ;
36+
37+ session . textMap . add ( 'Yes' , 'Yes' ) ;
38+ session . textMap . add ( 'No' , 'No' ) ;
3639 } ) ;
3740
3841 // ---------------------------------------------------------------
@@ -187,7 +190,7 @@ describe('BookmarkSupport', () => {
187190 expect ( bookmark ) . toBeInstanceOf ( BookmarkDo ) ;
188191 expect ( bookmark . id ) . toBeUndefined ( ) ;
189192 expect ( bookmark . title ) . toBe ( 'Outline 1 - Table Page 3' ) ;
190- expect ( bookmark . description ) . toBe ( 'Table Page 3\n text: "n" ' ) ;
193+ expect ( bookmark . description ) . toBe ( 'Table Page 3\n Text: n\n Show hidden values: No ' ) ;
191194 expect ( bookmark . definition ) . toBeInstanceOf ( OutlineBookmarkDefinitionDo ) ;
192195 let bookmarkDefinition = bookmark . definition as OutlineBookmarkDefinitionDo ;
193196 expect ( bookmarkDefinition . outlineId ) . toBe ( SPEC_OUTLINE_1_UUID ) ;
@@ -198,7 +201,9 @@ describe('BookmarkSupport', () => {
198201 expect ( bookmarkedPage . pageParam ) . toBeInstanceOf ( PageIdDummyPageParamDo ) ;
199202 expect ( ( bookmarkedPage . pageParam as PageIdDummyPageParamDo ) . pageId ) . toBe ( SPEC_TABLE_PAGE_3_UUID ) ;
200203 expect ( bookmarkedPage . searchData ) . toBeInstanceOf ( BaseDoEntity ) ;
201- expect ( ( bookmarkedPage . searchData as BaseDoEntity ) . toPojo ( ) ) . toEqual ( scout . create ( SpecSearchDo , { text : 'n' } ) . toPojo ( ) ) ;
204+ expect ( ( bookmarkedPage . searchData as BaseDoEntity ) . toPojo ( ) ) . toEqual ( scout . create ( SpecSearchDo , {
205+ text : 'n' , showHiddenValues : false , languages : [ ] , creationDate : null
206+ } ) . toPojo ( ) ) ;
202207
203208 expect ( bookmarkedPage . tablePreferences ) . toBeTruthy ( ) ;
204209 expect ( bookmarkedPage . tablePreferences . tableId ) . toBe ( `${ SPEC_TABLE_PAGE_3_TABLE_UUID } |${ SPEC_TABLE_PAGE_3_UUID } ` ) ;
@@ -322,7 +327,7 @@ describe('BookmarkSupport', () => {
322327 outline . drillDown ( page2 ) ;
323328 await page2 . ensureLoadChildren ( ) ;
324329 expect ( page2 . detailTable . rows . length ) . toBe ( 5 ) ;
325- page2 . setSearchFilter ( scout . create ( SpecSearchDo , { text : 'i' } ) ) ; // Matches 'Pineapple' and 'Kiwi'
330+ page2 . setSearchFilter ( scout . create ( SpecSearchDo , { text : 'i' , showHiddenValues : true } ) ) ; // Matches 'Pineapple' and 'Kiwi'
326331 page2 . reloadPage ( ) ;
327332 await page2 . ensureLoadChildren ( ) ;
328333 expect ( page2 . detailTable . rows . length ) . toBe ( 2 ) ;
@@ -355,7 +360,10 @@ describe('BookmarkSupport', () => {
355360 outline . drillDown ( page4 ) ;
356361 await page4 . ensureLoadChildren ( ) ;
357362 expect ( page4 . detailTable . rows . length ) . toBe ( 5 ) ;
358- page4 . setSearchFilter ( scout . create ( SpecSearchDo , { text : 'n' } ) ) ; // Matches 'Banana', 'Pineapple' and 'Lemon'
363+ jasmine . clock ( ) . install ( ) ;
364+ page4 . setSearchFilter ( scout . create ( SpecSearchDo , { text : 'n' , languages : [ 100 , 300 ] , creationDate : dates . create ( '1999-12-31' ) } ) ) ; // Matches 'Banana', 'Pineapple' and 'Lemon'
365+ jasmine . clock ( ) . tick ( 300 ) ; // wait for list box update the display text
366+ jasmine . clock ( ) . uninstall ( ) ;
359367 page4 . reloadPage ( ) ;
360368 await page4 . ensureLoadChildren ( ) ;
361369 expect ( page4 . detailTable . rows . length ) . toBe ( 3 ) ;
@@ -372,7 +380,17 @@ describe('BookmarkSupport', () => {
372380 expect ( bookmark ) . toBeInstanceOf ( BookmarkDo ) ;
373381 expect ( bookmark . id ) . toBeUndefined ( ) ;
374382 expect ( bookmark . title ) . toBe ( 'Outline 2 - Node Page 3 - Table Page 2 - Kiwi - Table Page 2' ) ;
375- expect ( bookmark . description ) . toBe ( 'Node Page 3\n Table Page 2\n text: "i"\n Kiwi\n Table Page 2\n text: "n"' ) ;
383+ expect ( bookmark . description ) . toBe ( '' +
384+ 'Node Page 3\n' +
385+ ' Table Page 2\n' +
386+ ' Text: i\n' +
387+ ' Show hidden values: Yes\n' +
388+ ' Kiwi\n' +
389+ ' Table Page 2\n' +
390+ ' Text: n\n' +
391+ ' Show hidden values: No\n' +
392+ ' Languages: English, Italian\n' +
393+ ' Creation date: 31.12.1999' ) ;
376394 expect ( bookmark . definition ) . toBeInstanceOf ( OutlineBookmarkDefinitionDo ) ;
377395 let bookmarkDefinition = bookmark . definition as OutlineBookmarkDefinitionDo ;
378396 expect ( bookmarkDefinition . outlineId ) . toBe ( SPEC_OUTLINE_2_UUID ) ;
@@ -390,7 +408,9 @@ describe('BookmarkSupport', () => {
390408 expect ( ( pagePathElement2 . pageParam as PageIdDummyPageParamDo ) . pageId ) . toBe ( SPEC_TABLE_PAGE_2_UUID ) ;
391409 expect ( pagePathElement2 . searchFilterComplete ) . toBe ( true ) ;
392410 expect ( pagePathElement2 . searchData ) . toBeInstanceOf ( BaseDoEntity ) ;
393- expect ( ( pagePathElement2 . searchData as BaseDoEntity ) . toPojo ( ) ) . toEqual ( scout . create ( SpecSearchDo , { text : 'i' } ) . toPojo ( ) ) ;
411+ expect ( ( pagePathElement2 . searchData as BaseDoEntity ) . toPojo ( ) ) . toEqual ( scout . create ( SpecSearchDo , {
412+ text : 'i' , showHiddenValues : true , languages : [ ] , creationDate : null
413+ } ) . toPojo ( ) ) ;
394414 expect ( pagePathElement2 . expandedChildRow ) . toBeInstanceOf ( BookmarkTableRowIdentifierDo ) ;
395415 expect ( pagePathElement2 . expandedChildRow . toPojo ( ) ) . toEqual ( scout . create ( BookmarkTableRowIdentifierDo , {
396416 keyComponents : [ scout . create ( BookmarkTableRowIdentifierStringComponentDo , { key : FRUIT_5_KEY } ) ]
@@ -408,7 +428,9 @@ describe('BookmarkSupport', () => {
408428 expect ( bookmarkedPage . pageParam ) . toBeInstanceOf ( PageIdDummyPageParamDo ) ;
409429 expect ( ( bookmarkedPage . pageParam as PageIdDummyPageParamDo ) . pageId ) . toBe ( SPEC_TABLE_PAGE_2_UUID ) ;
410430 expect ( bookmarkedPage . searchData ) . toBeInstanceOf ( BaseDoEntity ) ;
411- expect ( ( bookmarkedPage . searchData as BaseDoEntity ) . toPojo ( ) ) . toEqual ( scout . create ( SpecSearchDo , { text : 'n' } ) . toPojo ( ) ) ;
431+ expect ( ( bookmarkedPage . searchData as BaseDoEntity ) . toPojo ( ) ) . toEqual ( scout . create ( SpecSearchDo , {
432+ text : 'n' , showHiddenValues : false , languages : [ 100 , 300 ] , creationDate : dates . create ( '1999-12-31' )
433+ } ) . toPojo ( ) ) ;
412434 expect ( bookmarkedPage . expandedChildRow ) . toBe ( null ) ;
413435 expect ( bookmarkedPage . selectedChildRows . length ) . toBe ( 0 ) ; // selected rows are not exported by default
414436 } ) ;
@@ -482,7 +504,7 @@ describe('BookmarkSupport', () => {
482504 expect ( bookmark ) . toBeInstanceOf ( BookmarkDo ) ;
483505 expect ( bookmark . id ) . toBeUndefined ( ) ;
484506 expect ( bookmark . title ) . toBe ( 'Outline 3 - Table Page 2 - Kiwi' ) ;
485- expect ( bookmark . description ) . toBe ( 'Table Page 2\n text: "i" \n Kiwi' ) ;
507+ expect ( bookmark . description ) . toBe ( 'Table Page 2\n Text: i\n Show hidden values: No \n Kiwi' ) ;
486508 expect ( bookmark . definition ) . toBeInstanceOf ( OutlineBookmarkDefinitionDo ) ;
487509 let bookmarkDefinition = bookmark . definition as OutlineBookmarkDefinitionDo ;
488510 expect ( bookmarkDefinition . outlineId ) . toBe ( SPEC_OUTLINE_3_UUID ) ;
@@ -495,7 +517,9 @@ describe('BookmarkSupport', () => {
495517 expect ( ( pagePathElement1 . pageParam as PageIdDummyPageParamDo ) . pageId ) . toBe ( SPEC_TABLE_PAGE_2_UUID ) ;
496518 expect ( pagePathElement1 . searchFilterComplete ) . toBe ( true ) ;
497519 expect ( pagePathElement1 . searchData ) . toBeInstanceOf ( BaseDoEntity ) ;
498- expect ( ( pagePathElement1 . searchData as BaseDoEntity ) . toPojo ( ) ) . toEqual ( scout . create ( SpecSearchDo , { text : 'i' } ) . toPojo ( ) ) ;
520+ expect ( ( pagePathElement1 . searchData as BaseDoEntity ) . toPojo ( ) ) . toEqual ( scout . create ( SpecSearchDo , {
521+ text : 'i' , showHiddenValues : false , languages : [ ] , creationDate : null
522+ } ) . toPojo ( ) ) ;
499523 expect ( pagePathElement1 . expandedChildRow ) . toBeInstanceOf ( BookmarkTableRowIdentifierDo ) ;
500524 expect ( pagePathElement1 . expandedChildRow . toPojo ( ) ) . toEqual ( scout . create ( BookmarkTableRowIdentifierDo , {
501525 keyComponents : [ scout . create ( BookmarkTableRowIdentifierStringComponentDo , { key : FRUIT_5_KEY } ) ]
0 commit comments