@@ -21,25 +21,28 @@ declare global {
2121 }
2222}
2323
24- Cypress . Commands . add ( 'setUpApi' , ( database , appContext ) => {
25- Cypress . on ( 'window:before:load' , ( win : Window ) => {
26- // win.indexedDB.deleteDatabase('graasp-app-cypress');
27- // eslint-disable-next-line no-param-reassign
28- win . appContext = {
29- memberId : CURRENT_MEMBER . id ,
30- itemId : MOCK_SERVER_ITEM . id ,
31- apiHost : Cypress . env ( 'VITE_API_HOST' ) ,
32- context : Context . Player ,
33- ...appContext ,
34- } ;
35- // eslint-disable-next-line no-param-reassign
36- win . database = {
37- appData : [ ] ,
38- appActions : [ ] ,
39- appSettings : [ ] ,
40- members : Object . values ( MEMBERS ) ,
41- items : [ MOCK_SERVER_ITEM ] ,
42- ...database ,
43- } ;
44- } ) ;
45- } ) ;
24+ Cypress . Commands . add (
25+ 'setUpApi' ,
26+ ( database : Partial < Database > , appContext : Partial < LocalContext > ) => {
27+ Cypress . on ( 'window:before:load' , ( win : Window ) => {
28+ // win.indexedDB.deleteDatabase('graasp-app-cypress');
29+ // eslint-disable-next-line no-param-reassign
30+ win . appContext = {
31+ accountId : CURRENT_MEMBER . id ,
32+ itemId : MOCK_SERVER_ITEM . id ,
33+ apiHost : Cypress . env ( 'VITE_API_HOST' ) ,
34+ context : Context . Player ,
35+ ...appContext ,
36+ } ;
37+ // eslint-disable-next-line no-param-reassign
38+ win . database = {
39+ appData : [ ] ,
40+ appActions : [ ] ,
41+ appSettings : [ ] ,
42+ members : Object . values ( MEMBERS ) ,
43+ items : [ MOCK_SERVER_ITEM ] ,
44+ ...database ,
45+ } ;
46+ } ) ;
47+ } ,
48+ ) ;
0 commit comments