@@ -15,7 +15,7 @@ import completeSignCommand, {
15
15
extensionIdFile ,
16
16
getIdFromFile ,
17
17
} from '../../../src/cmd/sign.js' ;
18
- import { basicManifest , manifestWithoutApps , fixturePath } from '../helpers.js' ;
18
+ import { basicManifest , fixturePath } from '../helpers.js' ;
19
19
20
20
describe ( 'sign' , ( ) => {
21
21
function getStubs ( ) {
@@ -115,82 +115,6 @@ describe('sign', () => {
115
115
} ,
116
116
) ) ;
117
117
118
- it ( "doesn't allow a custom ID when no ID in manifest.json with submission api" , ( ) =>
119
- withTempDir ( async ( tmpDir ) => {
120
- const customId = 'some-custom-id' ;
121
- const stubs = getStubs ( ) ;
122
- const promiseSigned = sign ( tmpDir , stubs , {
123
- extraArgs : {
124
- id : customId ,
125
- } ,
126
- extraOptions : {
127
- preValidatedManifest : manifestWithoutApps ,
128
- } ,
129
- } ) ;
130
- await assert . isRejected ( promiseSigned , UsageError ) ;
131
- await assert . isRejected (
132
- promiseSigned ,
133
- / C a n n o t s e t c u s t o m I D s o m e - c u s t o m - i d / ,
134
- ) ;
135
- await assert . isRejected (
136
- promiseSigned ,
137
- / T h e a d d - o n I D m u s t b e s p e c i f i e d i n t h e m a n i f e s t .j s o n f i l e / ,
138
- ) ;
139
- } ) ) ;
140
-
141
- it ( "doesn't allow ID file when no ID in manifest.json with submission api" , ( ) =>
142
- withTempDir ( async ( tmpDir ) => {
143
- const sourceDir = path . join ( tmpDir . path ( ) , 'source-dir' ) ;
144
- const idFile = path . join ( sourceDir , extensionIdFile ) ;
145
- const stubs = getStubs ( ) ;
146
- await fs . mkdir ( sourceDir ) ;
147
- await saveIdToFile ( idFile , 'some-other-id' ) ;
148
- // Now, make a signing call with a custom ID.
149
- const promiseSigned = sign ( tmpDir , stubs , {
150
- extraArgs : {
151
- sourceDir,
152
- } ,
153
- extraOptions : {
154
- preValidatedManifest : manifestWithoutApps ,
155
- } ,
156
- } ) ;
157
-
158
- await assert . isRejected ( promiseSigned , UsageError ) ;
159
- await assert . isRejected (
160
- promiseSigned ,
161
- / C a n n o t u s e p r e v i o u s l y a u t o - g e n e r a t e d e x t e n s i o n I D / ,
162
- ) ;
163
- await assert . isRejected ( promiseSigned , / s o m e - o t h e r - i d - / ) ;
164
- await assert . isRejected (
165
- promiseSigned ,
166
- / T h i s a d d - o n I D m u s t b e s p e c i f i e d i n t h e m a n i f e s t .j s o n f i l e / ,
167
- ) ;
168
- } ) ) ;
169
-
170
- it ( 'disallows a custom ID when manifest.json has ID' , ( ) =>
171
- withTempDir ( async ( tmpDir ) => {
172
- const customId = 'some-custom-id' ;
173
- const stubs = getStubs ( ) ;
174
- const signPromise = sign ( tmpDir , stubs , {
175
- extraArgs : {
176
- id : customId ,
177
- } ,
178
- extraOptions : {
179
- // This manifest has an ID in it.
180
- preValidatedManifest : basicManifest ,
181
- } ,
182
- } ) ;
183
- await assert . isRejected ( signPromise , UsageError ) ;
184
- await assert . isRejected (
185
- signPromise ,
186
- / C a n n o t s e t c u s t o m I D s o m e - c u s t o m - i d / ,
187
- ) ;
188
- await assert . isRejected (
189
- signPromise ,
190
- / m a n i f e s t \. j s o n a l r e a d y d e f i n e s I D b a s i c - m a n i f e s t @ w e b - e x t - t e s t - s u i t e / ,
191
- ) ;
192
- } ) ) ;
193
-
194
118
it ( 'requires a channel for submission API' , ( ) =>
195
119
withTempDir ( async ( tmpDir ) => {
196
120
const stubs = getStubs ( ) ;
@@ -199,7 +123,7 @@ describe('sign', () => {
199
123
channel : '' ,
200
124
} ,
201
125
extraOptions : {
202
- preValidatedManifest : manifestWithoutApps ,
126
+ preValidatedManifest : basicManifest ,
203
127
} ,
204
128
} ) ;
205
129
await assert . isRejected ( signPromise , UsageError ) ;
0 commit comments