@@ -3,6 +3,9 @@ const bookshop = require("path").resolve(__dirname, "./../bookshop");
3
3
const { expect, data, POST , PATCH , DELETE } = cds . test ( bookshop ) ;
4
4
const { RequestSend } = require ( "../utils/api" ) ;
5
5
6
+ // Enable locale fallback to simulate end user requests
7
+ cds . env . features . locale_fallback = true
8
+
6
9
jest . setTimeout ( 5 * 60 * 1000 ) ;
7
10
8
11
let adminService = null ;
@@ -27,7 +30,7 @@ describe("change log integration test", () => {
27
30
await data . reset ( ) ;
28
31
} ) ;
29
32
30
-
33
+
31
34
it ( "1.5 When the global switch is on, all changelogs should be retained after the root entity is deleted, and a changelog for the deletion operation should be generated" , async ( ) => {
32
35
cds . env . requires [ "change-tracking" ] . preserveDeletes = true ;
33
36
@@ -63,14 +66,14 @@ describe("change log integration test", () => {
63
66
true ,
64
67
) ;
65
68
const beforeChanges = await adminService . run ( SELECT . from ( ChangeView ) ) ;
66
- expect ( beforeChanges . length > 0 ) . to . be . true ;
67
-
69
+ expect ( beforeChanges . length > 0 ) . to . be . true ;
70
+
68
71
await DELETE ( `/odata/v4/admin/RootEntity(ID=01234567-89ab-cdef-0123-987654fedcba,IsActiveEntity=true)` ) ;
69
72
70
73
const afterChanges = await adminService . run ( SELECT . from ( ChangeView ) ) ;
71
74
72
- const changelogCreated = afterChanges . filter ( ele => ele . modification === "Create" ) ;
73
- const changelogDeleted = afterChanges . filter ( ele => ele . modification === "Delete" ) ;
75
+ const changelogCreated = afterChanges . filter ( ele => ele . modification === "Create" ) ;
76
+ const changelogDeleted = afterChanges . filter ( ele => ele . modification === "Delete" ) ;
74
77
75
78
const compareAttributes = [ 'keys' , 'attribute' , 'entity' , 'serviceEntity' , 'parentKey' , 'serviceEntityPath' , 'valueDataType' , 'objectID' , 'parentObjectID' , 'entityKey' ] ;
76
79
@@ -279,7 +282,7 @@ describe("change log integration test", () => {
279
282
280
283
it ( "2.2 Child entity update - should log basic data type changes (ERP4SMEPREPWORKAPPPLAT-32 ERP4SMEPREPWORKAPPPLAT-613)" , async ( ) => {
281
284
cds . services . AdminService . entities . Books . elements . price [ "@changelog" ] = true ;
282
-
285
+
283
286
const action = PATCH . bind ( { } , `/odata/v4/admin/Books(ID=9d703c23-54a8-4eff-81c1-cdce6b8376b1,IsActiveEntity=false)` , {
284
287
title : "new title" ,
285
288
author_ID : "47f97f40-4f41-488a-b10b-a5725e762d5e" ,
@@ -549,7 +552,7 @@ describe("change log integration test", () => {
549
552
await utils . apiAction ( "admin" , "BookStores" , "64625905-c234-4d0d-9bc1-283ee8946770" , "AdminService" , action ) ;
550
553
551
554
const changes = await adminService . run ( SELECT . from ( ChangeView ) ) ;
552
-
555
+
553
556
expect ( changes . length ) . to . equal ( 1 ) ;
554
557
const change = changes [ 0 ] ;
555
558
expect ( change . attribute ) . to . equal ( "title" ) ;
@@ -1038,7 +1041,7 @@ describe("change log integration test", () => {
1038
1041
1039
1042
it ( "7.1 Annotate fields from chained associated entities as objectID (ERP4SMEPREPWORKAPPPLAT-993)" , async ( ) => {
1040
1043
cds . services . AdminService . entities . BookStores [ "@changelog" ] . push ( { "=" : "city.name" } )
1041
-
1044
+
1042
1045
const createBookStoresAction = POST . bind ( { } , `/odata/v4/admin/BookStores` , {
1043
1046
ID : "9d703c23-54a8-4eff-81c1-cdce6b6587c4" ,
1044
1047
name : "new name" ,
0 commit comments