@@ -9,11 +9,18 @@ describe('getBackupData and setBackupData', function () {
9
9
let manager = null ;
10
10
const first_plugin_uid = 'Available AP statistics+https://github.com/IITC-CE/ingress-intel-total-conversion' ;
11
11
const external_code = '// ==UserScript==\n// @name IITC plugin\n// ==/UserScript==\nreturn false;' ;
12
+ const external_iitc_code =
13
+ '// ==UserScript==\n' +
14
+ '// @name IITC: Ingress intel map total conversion\n' +
15
+ '// @namespace https://github.com/IITC-CE/ingress-intel-total-conversion\n' +
16
+ '// ==/UserScript==\n' +
17
+ 'return false;' ;
12
18
const initialBackupData = {
13
19
external_plugins : {
14
20
beta : { } ,
15
21
custom : { } ,
16
22
release : {
23
+ 'total-conversion-build.user.js' : external_iitc_code ,
17
24
'bookmarks1.user.js' : external_code ,
18
25
} ,
19
26
} ,
@@ -39,6 +46,7 @@ describe('getBackupData and setBackupData', function () {
39
46
'bookmarks2.user.js' : external_code ,
40
47
} ,
41
48
beta : {
49
+ 'total-conversion-build.user.js' : external_iitc_code ,
42
50
'bookmarks3.user.js' : external_code ,
43
51
} ,
44
52
} ,
@@ -90,6 +98,31 @@ describe('getBackupData and setBackupData', function () {
90
98
const run = await manager . managePlugin ( first_plugin_uid , 'on' ) ;
91
99
expect ( run ) . to . be . undefined ;
92
100
} ) ;
101
+ it ( 'Add custom IITC core' , async function ( ) {
102
+ const scripts = [
103
+ {
104
+ meta : {
105
+ id : 'total-conversion-build' ,
106
+ namespace : 'https://github.com/IITC-CE/ingress-intel-total-conversion' ,
107
+ name : 'IITC: Ingress intel map total conversion' ,
108
+ filename : 'total-conversion-build.user.js' ,
109
+ } ,
110
+ code : external_iitc_code ,
111
+ } ,
112
+ ] ;
113
+ const installed = {
114
+ 'IITC: Ingress intel map total conversion+https://github.com/IITC-CE/ingress-intel-total-conversion' : {
115
+ uid : 'IITC: Ingress intel map total conversion+https://github.com/IITC-CE/ingress-intel-total-conversion' ,
116
+ id : 'total-conversion-build' ,
117
+ namespace : 'https://github.com/IITC-CE/ingress-intel-total-conversion' ,
118
+ name : 'IITC: Ingress intel map total conversion' ,
119
+ code : external_iitc_code ,
120
+ filename : 'total-conversion-build.user.js' ,
121
+ } ,
122
+ } ;
123
+ const run = await manager . addUserScripts ( scripts ) ;
124
+ expect ( run ) . to . deep . equal ( installed ) ;
125
+ } ) ;
93
126
it ( 'Add external plugin' , async function ( ) {
94
127
const scripts = [
95
128
{
@@ -155,6 +188,15 @@ describe('getBackupData and setBackupData', function () {
155
188
VMin9999 : 'backup2' ,
156
189
} ) ;
157
190
191
+ const externalCore = await storage . get ( [ 'beta_iitc_core_user' ] ) ;
192
+ expect ( externalCore [ 'beta_iitc_core_user' ] ) . to . deep . equal ( {
193
+ uid : 'IITC: Ingress intel map total conversion+https://github.com/IITC-CE/ingress-intel-total-conversion' ,
194
+ name : 'IITC: Ingress intel map total conversion' ,
195
+ namespace : 'https://github.com/IITC-CE/ingress-intel-total-conversion' ,
196
+ code : external_iitc_code ,
197
+ filename : 'total-conversion-build.user.js' ,
198
+ } ) ;
199
+
158
200
const externalPlugins = await storage . get ( [ 'release_plugins_user' , 'beta_plugins_user' ] ) ;
159
201
expect ( externalPlugins [ 'release_plugins_user' ] ) . to . have . all . keys (
160
202
'Bookmarks for maps and portals+https://github.com/IITC-CE/ingress-intel-total-conversion' ,
0 commit comments