@@ -276,68 +276,6 @@ export class TemplateAnalysisTests {
276
276
} ) ;
277
277
}
278
278
279
- @test "adding the same styles more than once doesn't duplicate the styles found" ( ) {
280
- let info = new Template ( "templates/my-template.hbs" ) ;
281
- let analysis = new TemplateAnalysis ( info ) ;
282
- let imports = new MockImportRegistry ( ) ;
283
-
284
- let options : PluginOptions = { importer : imports . importer ( ) } ;
285
- let reader = new OptionsReader ( options ) ;
286
-
287
- let css = `
288
- [state|color=red] { color: red; }
289
- [state|color=blue] { color: blue; }
290
- [state|bgcolor=red] { color: red; }
291
- [state|bgcolor=blue] { color: blue; }
292
- ` ;
293
- return this . parseBlock ( css , "blocks/foo.block.css" , reader ) . then ( ( [ block , _ ] ) => {
294
- analysis . blocks [ "" ] = block ;
295
- let element : TestElement = analysis . startElement ( { line : 10 , column : 32 } ) ;
296
- element . addStaticClass ( block . rootClass ) ;
297
- element . addDynamicGroup ( block . rootClass , block . rootClass . resolveGroup ( "color" ) as StateGroup , null ) ;
298
- element . addDynamicGroup ( block . rootClass , block . rootClass . resolveGroup ( "color" ) as StateGroup , null , true ) ;
299
- analysis . endElement ( element ) ;
300
-
301
- let result = analysis . serialize ( ) ;
302
- let expectedResult : SerializedTemplateAnalysis < "Opticss.Template" > = {
303
- blocks : { "" : "blocks/foo.block.css" } ,
304
- template : { type : "Opticss.Template" , identifier : "templates/my-template.hbs" } ,
305
- stylesFound : [
306
- ".root" ,
307
- "[state|color=blue]" ,
308
- "[state|color=red]" ,
309
- ] ,
310
- elements : {
311
- "a" : {
312
- "sourceLocation" : {
313
- "start" : { filename : "templates/my-template.hbs" , "column" : 32 , "line" : 10 } ,
314
- } ,
315
- "staticStyles" : [ 0 ] ,
316
- "dynamicClasses" : [ ] ,
317
- "dynamicStates" : [
318
- {
319
- "stringExpression" : true ,
320
- "group" : {
321
- "blue" : 1 ,
322
- "red" : 2 ,
323
- } ,
324
- } ,
325
- {
326
- "stringExpression" : true ,
327
- "disallowFalsy" : true ,
328
- "group" : {
329
- "blue" : 1 ,
330
- "red" : 2 ,
331
- } ,
332
- } ,
333
- ] ,
334
- } ,
335
- } ,
336
- } ;
337
-
338
- assert . deepEqual ( result , expectedResult ) ;
339
- } ) ;
340
- }
341
279
@test "multiple exclusive dynamic values added using enumerate correlations correctly in analysis" ( ) {
342
280
let info = new Template ( "templates/my-template.hbs" ) ;
343
281
let analysis = new TemplateAnalysis ( info ) ;
0 commit comments