File tree Expand file tree Collapse file tree
src/server/plugins/engine/components Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -52,21 +52,18 @@ describe('List', () => {
5252 it ( 'returns list items' , ( ) => {
5353 expect ( guidance ) . toHaveProperty ( 'items' , [
5454 {
55- id : '52fc51fc-c75a-4b08-9c9e-6bd99b9bc49b' ,
5655 text : '1 day' ,
5756 value : 1 ,
5857 description :
5958 'Valid for 24 hours from the start time that you select'
6059 } ,
6160 {
62- id : '56b7b34f-23b3-4446-ac8e-b2443d18588e' ,
6361 text : '8 day' ,
6462 value : 8 ,
6563 description :
6664 'Valid for 8 consecutive days from the start time that you select'
6765 } ,
6866 {
69- id : '1af54fbc-eec2-4e1e-bd53-2415abf62677' ,
7067 text : '12 months' ,
7168 value : 365 ,
7269 description :
Original file line number Diff line number Diff line change @@ -48,7 +48,12 @@ export class ListFormComponent extends FormComponent {
4848 listType : List [ 'type' ] = 'string'
4949
5050 get items ( ) : Item [ ] {
51- return this . list ?. items ?? [ ]
51+ return (
52+ this . list ?. items . map ( ( item ) => {
53+ delete item . id // temporary workaround to prevent an ID being set, which invalidates #componentName fragments in the links
54+ return item
55+ } ) ?? [ ]
56+ )
5257 }
5358
5459 get values ( ) : Item [ 'value' ] [ ] {
Original file line number Diff line number Diff line change 55 */
66export function createListItemFactory ( partialListItem ) {
77 return {
8- id : '52fc51fc-c75a-4b08-9c9e-6bd99b9bc49b' ,
98 text : 'text' ,
109 value : 1 ,
1110 description : 'Valid for 24 hours from the start time that you select' ,
@@ -20,7 +19,6 @@ export function createListItemFactory(partialListItem) {
2019 */
2120export function createListFromFactory ( partialList ) {
2221 return {
23- id : '4ebe4ef5-bd3c-499b-a179-7e7e86b0dc6f' ,
2422 name : 'licenceLengthDays' ,
2523 title : 'Licence length (days)' ,
2624 type : 'number' ,
You can’t perform that action at this time.
0 commit comments