@@ -136,5 +136,53 @@ describe("bit-docs-html-codepen-link", function() {
136
136
137
137
assert ( data , "got data" ) ;
138
138
assert . equal ( data . html . trim ( ) , "<div>Hello world</div>" ) ;
139
- } )
139
+ } ) ;
140
+
141
+ it ( "Does not remove styles from within a template" , function ( ) {
142
+ var data = codepenData . html ( `
143
+ <template>
144
+ <style>.root { display: block; }</style>
145
+ </template>
146
+ <script type="module"></script>
147
+ ` ) ;
148
+
149
+ assert ( ! data . css , "There should not be css" ) ;
150
+ assert . equal ( data . html . trim ( ) , `
151
+ <template>
152
+ <style>.root { display: block; }</style>
153
+ </template>
154
+ ` . trim ( ) ) ;
155
+ } ) ;
156
+
157
+ it ( "Does not remove scripts from within a template" , function ( ) {
158
+ var data = codepenData . html ( `
159
+ <template>
160
+ <script>console.log('testing');</script>
161
+ </template>
162
+ <script type="module"></script>
163
+ ` ) ;
164
+
165
+ assert ( ! data . js , "There should not be js" ) ;
166
+ assert . equal ( data . html . trim ( ) , `
167
+ <template>
168
+ <script>console.log('testing');</script>
169
+ </template>
170
+ ` . trim ( ) ) ;
171
+ } ) ;
172
+
173
+ it ( "Does not remove module scripts from within a template" , function ( ) {
174
+ var data = codepenData . html ( `
175
+ <template>
176
+ <script type="module">console.log('testing');</script>
177
+ </template>
178
+ <script type="module"></script>
179
+ ` ) ;
180
+
181
+ assert ( ! data . js , "There should not be js" ) ;
182
+ assert . equal ( data . html . trim ( ) , `
183
+ <template>
184
+ <script type="module">console.log('testing');</script>
185
+ </template>
186
+ ` . trim ( ) ) ;
187
+ } ) ;
140
188
} ) ;
0 commit comments