@@ -82,6 +82,30 @@ describe("Template Rewriting", function() {
82
82
) ;
83
83
} ) ;
84
84
85
+ it ( "rewrites styles from dynamic inherited attributes" , async function ( ) {
86
+ let projectDir = fixture ( "styled-app" ) ;
87
+ let analyzer = new GlimmerAnalyzer ( new BlockFactory ( { } ) , { } , moduleConfig ) ;
88
+ let templatePath = fixture ( "styled-app/src/ui/components/with-dynamic-inherited-states/template.hbs" ) ;
89
+ let result = await pipeline ( projectDir , analyzer , "with-dynamic-inherited-states" , templatePath ) ;
90
+
91
+ // TODO why is `f` class both static and dynamic?
92
+ assert . deepEqual ( minify ( print ( result . ast ) ) , minify ( `
93
+ <div class="grandparent parent stylesheet {{-css-blocks-classnames 1 7 4 4 1 @style "open" 3 2 4 5 "condensed" 1 0 "normal" 2 1 3 "spacious" 1 6 "f" 0 "g" 1 "e" 2 "d" 3 "c" 4 "a" 5 "b" 6}}">
94
+ Inheritance Test
95
+ </div>
96
+ ` ) ) ;
97
+ assert . deepEqual ( minify ( result . css . toString ( ) ) , minify (
98
+ ".a { line-height: 2em; } " + // block[style=open]
99
+ ".b { line-height: 3em; } " + // block[style=spacious]
100
+ ".c { margin: 1em; } " + // parent[style=open]
101
+ ".d { margin: 0.5em; } " + // parent[style=normal]
102
+ ".e { padding: 2em; } " + // grandparent[style=open]
103
+ ".f { padding: 0.5em; } " + // grandparent[style=condensed]
104
+ ".g { padding: 1em; }" // grandparent[style=normal]
105
+ ) ,
106
+ ) ;
107
+ } ) ;
108
+
85
109
it ( "rewrites styles from dynamic classes" , async function ( ) {
86
110
let projectDir = fixture ( "styled-app" ) ;
87
111
let analyzer = new GlimmerAnalyzer ( new BlockFactory ( { } ) , { } , moduleConfig ) ;
0 commit comments