@@ -18,15 +18,15 @@ const typeTestTitle = () => 'Type Test Title' as Platform.UIString.LocalizedStri
1818
1919describe ( 'ResourceCategory class' , ( ) => {
2020 it ( 'is able to be instantiated successfully' , ( ) => {
21- const resourceCategory = new ResourceCategory ( testTitle , testShortTitle ) ;
21+ const resourceCategory = new ResourceCategory ( 'category name' , testTitle , testShortTitle ) ;
2222 assert . strictEqual ( resourceCategory . title ( ) , 'Test Title' , 'title is not correct' ) ;
2323 assert . strictEqual ( resourceCategory . shortTitle ( ) , 'Test Short Title' , 'short title is not correct' ) ;
2424 } ) ;
2525} ) ;
2626
2727describeWithEnvironment ( 'ResourceType class' , ( ) => {
2828 it ( 'is able to be instantiated successfully' , ( ) => {
29- const testResourceCategory = new ResourceCategory ( categoryTestTitle , categoryTestShortTitle ) ;
29+ const testResourceCategory = new ResourceCategory ( 'category name' , categoryTestTitle , categoryTestShortTitle ) ;
3030 const resourceType = new ResourceType ( 'Type Test Name' , typeTestTitle , testResourceCategory , true ) ;
3131 assert . strictEqual ( resourceType . name ( ) , 'Type Test Name' , 'name was not set correctly' ) ;
3232 assert . strictEqual ( resourceType . title ( ) , 'Type Test Title' , 'title was not set correctly' ) ;
@@ -234,153 +234,153 @@ describeWithEnvironment('ResourceType class', () => {
234234 } ) ;
235235
236236 it ( 'is able to return its title successfully' , ( ) => {
237- const testResourceCategory = new ResourceCategory ( categoryTestTitle , categoryTestShortTitle ) ;
237+ const testResourceCategory = new ResourceCategory ( 'category name' , categoryTestTitle , categoryTestShortTitle ) ;
238238 const resourceType = new ResourceType ( 'Type Test Name' , typeTestTitle , testResourceCategory , true ) ;
239239 assert . strictEqual ( resourceType . title ( ) , 'Type Test Title' , 'title was not returned correctly' ) ;
240240 } ) ;
241241
242242 it ( 'is able to return its isTextType value successfully' , ( ) => {
243- const testResourceCategory = new ResourceCategory ( categoryTestTitle , categoryTestShortTitle ) ;
243+ const testResourceCategory = new ResourceCategory ( 'category name' , categoryTestTitle , categoryTestShortTitle ) ;
244244 const resourceType = new ResourceType ( 'Type Test Name' , typeTestTitle , testResourceCategory , true ) ;
245245 assert . isTrue ( resourceType . isTextType ( ) , 'isTextType was not returned correctly' ) ;
246246 } ) ;
247247
248248 it ( 'is able to return whether or not its a script if its name equals the value "script"' , ( ) => {
249- const testResourceCategory = new ResourceCategory ( categoryTestTitle , categoryTestShortTitle ) ;
249+ const testResourceCategory = new ResourceCategory ( 'category name' , categoryTestTitle , categoryTestShortTitle ) ;
250250 const resourceType = new ResourceType ( 'script' , typeTestTitle , testResourceCategory , true ) ;
251251 assert . isTrue ( resourceType . isScript ( ) , 'the resource should be considered as a script' ) ;
252252 } ) ;
253253
254254 it ( 'is able to return whether or not its a script if its name equals the value "sm-script"' , ( ) => {
255- const testResourceCategory = new ResourceCategory ( categoryTestTitle , categoryTestShortTitle ) ;
255+ const testResourceCategory = new ResourceCategory ( 'category name' , categoryTestTitle , categoryTestShortTitle ) ;
256256 const resourceType = new ResourceType ( 'sm-script' , typeTestTitle , testResourceCategory , true ) ;
257257 assert . isTrue ( resourceType . isScript ( ) , 'the resource should be considered as a script' ) ;
258258 } ) ;
259259
260260 it ( 'is able to return whether or not its a script if its name is not equal to the values "script" or "sm-script"' ,
261261 ( ) => {
262- const testResourceCategory = new ResourceCategory ( categoryTestTitle , categoryTestShortTitle ) ;
262+ const testResourceCategory = new ResourceCategory ( 'category name' , categoryTestTitle , categoryTestShortTitle ) ;
263263 const resourceType = new ResourceType ( 'Type Test Name' , typeTestTitle , testResourceCategory , true ) ;
264264 assert . isFalse ( resourceType . isScript ( ) , 'the resource should not be considered as a script' ) ;
265265 } ) ;
266266
267267 it ( 'is able to return whether or not its a document if its name equals the value "document"' , ( ) => {
268- const testResourceCategory = new ResourceCategory ( categoryTestTitle , categoryTestShortTitle ) ;
268+ const testResourceCategory = new ResourceCategory ( 'category name' , categoryTestTitle , categoryTestShortTitle ) ;
269269 const resourceType = new ResourceType ( 'document' , typeTestTitle , testResourceCategory , true ) ;
270270 assert . isTrue ( resourceType . isDocument ( ) , 'the resource should be considered as a document' ) ;
271271 } ) ;
272272
273273 it ( 'is able to return whether or not its a document if its name does not equal the value "document"' , ( ) => {
274- const testResourceCategory = new ResourceCategory ( categoryTestTitle , categoryTestShortTitle ) ;
274+ const testResourceCategory = new ResourceCategory ( 'category name' , categoryTestTitle , categoryTestShortTitle ) ;
275275 const resourceType = new ResourceType ( 'Type Test Name' , typeTestTitle , testResourceCategory , true ) ;
276276 assert . isFalse ( resourceType . isDocument ( ) , 'the resource should not be considered as a document' ) ;
277277 } ) ;
278278
279279 it ( 'is able to determine if a resource has scripts if it is a script' , ( ) => {
280- const testResourceCategory = new ResourceCategory ( categoryTestTitle , categoryTestShortTitle ) ;
280+ const testResourceCategory = new ResourceCategory ( 'category name' , categoryTestTitle , categoryTestShortTitle ) ;
281281 const resourceType = new ResourceType ( 'script' , typeTestTitle , testResourceCategory , true ) ;
282282 assert . isTrue ( resourceType . hasScripts ( ) , 'the resource should be considered as a having scripts' ) ;
283283 } ) ;
284284
285285 it ( 'is able to determine if a resource has scripts if it is a document' , ( ) => {
286- const testResourceCategory = new ResourceCategory ( categoryTestTitle , categoryTestShortTitle ) ;
286+ const testResourceCategory = new ResourceCategory ( 'category name' , categoryTestTitle , categoryTestShortTitle ) ;
287287 const resourceType = new ResourceType ( 'document' , typeTestTitle , testResourceCategory , true ) ;
288288 assert . isTrue ( resourceType . hasScripts ( ) , 'the resource should be considered as a having scripts' ) ;
289289 } ) ;
290290
291291 it ( 'is able to determine if a resource has scripts if it is not a script or a document' , ( ) => {
292- const testResourceCategory = new ResourceCategory ( categoryTestTitle , categoryTestShortTitle ) ;
292+ const testResourceCategory = new ResourceCategory ( 'category name' , categoryTestTitle , categoryTestShortTitle ) ;
293293 const resourceType = new ResourceType ( 'Type Test Name' , typeTestTitle , testResourceCategory , true ) ;
294294 assert . isFalse ( resourceType . hasScripts ( ) , 'the resource should not be considered as a having scripts' ) ;
295295 } ) ;
296296
297297 it ( 'is able to return whether or not its a stylesheet if its name equals the value "stylesheet"' , ( ) => {
298- const testResourceCategory = new ResourceCategory ( categoryTestTitle , categoryTestShortTitle ) ;
298+ const testResourceCategory = new ResourceCategory ( 'category name' , categoryTestTitle , categoryTestShortTitle ) ;
299299 const resourceType = new ResourceType ( 'stylesheet' , typeTestTitle , testResourceCategory , true ) ;
300300 assert . isTrue ( resourceType . isStyleSheet ( ) , 'the resource should be considered as a stylesheet' ) ;
301301 } ) ;
302302
303303 it ( 'is able to return whether or not its a stylesheet if its name equals the value "sm-stylesheet"' , ( ) => {
304- const testResourceCategory = new ResourceCategory ( categoryTestTitle , categoryTestShortTitle ) ;
304+ const testResourceCategory = new ResourceCategory ( 'category name' , categoryTestTitle , categoryTestShortTitle ) ;
305305 const resourceType = new ResourceType ( 'sm-stylesheet' , typeTestTitle , testResourceCategory , true ) ;
306306 assert . isTrue ( resourceType . isStyleSheet ( ) , 'the resource should be considered as a stylesheet' ) ;
307307 } ) ;
308308
309309 it ( 'is able to return whether or not its a stylesheet if its name is not equal to the values "stylesheet" or "sm-stylesheet"' ,
310310 ( ) => {
311- const testResourceCategory = new ResourceCategory ( categoryTestTitle , categoryTestShortTitle ) ;
311+ const testResourceCategory = new ResourceCategory ( 'category name' , categoryTestTitle , categoryTestShortTitle ) ;
312312 const resourceType = new ResourceType ( 'Type Test Name' , typeTestTitle , testResourceCategory , true ) ;
313313 assert . isFalse ( resourceType . isStyleSheet ( ) , 'the resource should not be considered as a stylesheet' ) ;
314314 } ) ;
315315
316316 it ( 'is able to return whether it is a document, a script or a stylesheet if it was a document' , ( ) => {
317- const testResourceCategory = new ResourceCategory ( categoryTestTitle , categoryTestShortTitle ) ;
317+ const testResourceCategory = new ResourceCategory ( 'category name' , categoryTestTitle , categoryTestShortTitle ) ;
318318 const resourceType = new ResourceType ( 'document' , typeTestTitle , testResourceCategory , true ) ;
319319 assert . isTrue ( resourceType . isDocumentOrScriptOrStyleSheet ( ) , 'the resource should be considered as a document' ) ;
320320 } ) ;
321321
322322 it ( 'is able to return whether it is a document, a script or a stylesheet if it was a script' , ( ) => {
323- const testResourceCategory = new ResourceCategory ( categoryTestTitle , categoryTestShortTitle ) ;
323+ const testResourceCategory = new ResourceCategory ( 'category name' , categoryTestTitle , categoryTestShortTitle ) ;
324324 const resourceType = new ResourceType ( 'script' , typeTestTitle , testResourceCategory , true ) ;
325325 assert . isTrue ( resourceType . isDocumentOrScriptOrStyleSheet ( ) , 'the resource should be considered as a script' ) ;
326326 } ) ;
327327
328328 it ( 'is able to return whether it is a document, a script or a stylesheet if it was a stylesheet' , ( ) => {
329- const testResourceCategory = new ResourceCategory ( categoryTestTitle , categoryTestShortTitle ) ;
329+ const testResourceCategory = new ResourceCategory ( 'category name' , categoryTestTitle , categoryTestShortTitle ) ;
330330 const resourceType = new ResourceType ( 'stylesheet' , typeTestTitle , testResourceCategory , true ) ;
331331 assert . isTrue ( resourceType . isDocumentOrScriptOrStyleSheet ( ) , 'the resource should be considered as a stylesheet' ) ;
332332 } ) ;
333333
334334 it ( 'is able to return whether it is a document, a script or a stylesheet if it was none of those things' , ( ) => {
335- const testResourceCategory = new ResourceCategory ( categoryTestTitle , categoryTestShortTitle ) ;
335+ const testResourceCategory = new ResourceCategory ( 'category name' , categoryTestTitle , categoryTestShortTitle ) ;
336336 const resourceType = new ResourceType ( 'Type Test Name' , typeTestTitle , testResourceCategory , true ) ;
337337 assert . isFalse (
338338 resourceType . isDocumentOrScriptOrStyleSheet ( ) ,
339339 'the resource should be considered as a doucment, a script or a stylesheet' ) ;
340340 } ) ;
341341
342342 it ( 'is able to determine if it is from source map if it began with "sm-"' , ( ) => {
343- const testResourceCategory = new ResourceCategory ( categoryTestTitle , categoryTestShortTitle ) ;
343+ const testResourceCategory = new ResourceCategory ( 'category name' , categoryTestTitle , categoryTestShortTitle ) ;
344344 const resourceType = new ResourceType ( 'sm-Type Test Name' , typeTestTitle , testResourceCategory , true ) ;
345345 assert . isTrue ( resourceType . isFromSourceMap ( ) , 'the resource should be considered to be from source map' ) ;
346346 } ) ;
347347
348348 it ( 'is able to determine if it is from source map if it did not begin with "sm-"' , ( ) => {
349- const testResourceCategory = new ResourceCategory ( categoryTestTitle , categoryTestShortTitle ) ;
349+ const testResourceCategory = new ResourceCategory ( 'category name' , categoryTestTitle , categoryTestShortTitle ) ;
350350 const resourceType = new ResourceType ( 'Type Test Name' , typeTestTitle , testResourceCategory , true ) ;
351351 assert . isFalse ( resourceType . isFromSourceMap ( ) , 'the resource should not be considered to be from source map' ) ;
352352 } ) ;
353353
354354 it ( 'is able to be converted to a string by returning its name' , ( ) => {
355- const testResourceCategory = new ResourceCategory ( categoryTestTitle , categoryTestShortTitle ) ;
355+ const testResourceCategory = new ResourceCategory ( 'category name' , categoryTestTitle , categoryTestShortTitle ) ;
356356 const resourceType = new ResourceType ( 'Type Test Name' , typeTestTitle , testResourceCategory , true ) ;
357357 assert . strictEqual (
358358 resourceType . toString ( ) , 'Type Test Name' , 'the resource type was not converted to a string correctly' ) ;
359359 } ) ;
360360
361361 it ( 'is able to return the canonical mime type of a document' , ( ) => {
362- const testResourceCategory = new ResourceCategory ( categoryTestTitle , categoryTestShortTitle ) ;
362+ const testResourceCategory = new ResourceCategory ( 'category name' , categoryTestTitle , categoryTestShortTitle ) ;
363363 const resourceType = new ResourceType ( 'document' , typeTestTitle , testResourceCategory , true ) ;
364364 assert . strictEqual (
365365 resourceType . canonicalMimeType ( ) , 'text/html' , 'the canonical mime type was not returned correctly' ) ;
366366 } ) ;
367367
368368 it ( 'is able to return the canonical mime type of a script' , ( ) => {
369- const testResourceCategory = new ResourceCategory ( categoryTestTitle , categoryTestShortTitle ) ;
369+ const testResourceCategory = new ResourceCategory ( 'category name' , categoryTestTitle , categoryTestShortTitle ) ;
370370 const resourceType = new ResourceType ( 'script' , typeTestTitle , testResourceCategory , true ) ;
371371 assert . strictEqual (
372372 resourceType . canonicalMimeType ( ) , 'text/javascript' , 'the canonical mime type was not returned correctly' ) ;
373373 } ) ;
374374
375375 it ( 'is able to return the canonical mime type of a stylesheet' , ( ) => {
376- const testResourceCategory = new ResourceCategory ( categoryTestTitle , categoryTestShortTitle ) ;
376+ const testResourceCategory = new ResourceCategory ( 'category name' , categoryTestTitle , categoryTestShortTitle ) ;
377377 const resourceType = new ResourceType ( 'stylesheet' , typeTestTitle , testResourceCategory , true ) ;
378378 assert . strictEqual (
379379 resourceType . canonicalMimeType ( ) , 'text/css' , 'the canonical mime type was not returned correctly' ) ;
380380 } ) ;
381381
382382 it ( 'returns an empty string as a canonical mime type if it was not a document, a script or a stylesheet' , ( ) => {
383- const testResourceCategory = new ResourceCategory ( categoryTestTitle , categoryTestShortTitle ) ;
383+ const testResourceCategory = new ResourceCategory ( 'category name' , categoryTestTitle , categoryTestShortTitle ) ;
384384 const resourceType = new ResourceType ( 'Type Test Name' , typeTestTitle , testResourceCategory , true ) ;
385385 assert . strictEqual ( resourceType . canonicalMimeType ( ) , '' , 'the canonical mime type was not returned correctly' ) ;
386386 } ) ;
0 commit comments