@@ -14,13 +14,17 @@ describe("basic tests", function() {
14
14
localScopedCss = ":local(.className) { background: red; }" ,
15
15
requiredStyle = `<style type="text/css">${ requiredCss } </style>` ,
16
16
existingStyle = "<style>.existing { color: yellow }</style>" ,
17
+ checkValue = '<div class="check">check</div>' ,
17
18
rootDir = path . resolve ( __dirname + "/../" ) + "/" ,
18
19
jsdomHtml = [
19
20
"<html>" ,
20
21
"<head>" ,
21
22
existingStyle ,
22
23
"</head>" ,
23
24
"<body>" ,
25
+ "<div class='target'>" ,
26
+ checkValue ,
27
+ "</div>" ,
24
28
"</body>" ,
25
29
"</html>"
26
30
] . join ( "\n" ) ;
@@ -83,6 +87,15 @@ describe("basic tests", function() {
83
87
runCompilerTest ( expected , done ) ;
84
88
} ) ; // it insert at top
85
89
90
+ it ( "insert into" , function ( done ) {
91
+ let selector = "div.target" ;
92
+ styleLoaderOptions . insertInto = selector ;
93
+
94
+ let expected = [ checkValue , requiredStyle ] . join ( "\n" ) ;
95
+
96
+ runCompilerTest ( expected , done , undefined , selector ) ;
97
+ } ) ; // it insert into
98
+
86
99
it ( "singleton" , function ( done ) {
87
100
// Setup
88
101
styleLoaderOptions . singleton = true ;
@@ -218,4 +231,4 @@ describe("basic tests", function() {
218
231
runCompilerTest ( expected , done , function ( ) { return this . css . locals . className ; } ) ;
219
232
} ) ; // it local scope
220
233
221
- } ) ; // describe
234
+ } ) ; // describe
0 commit comments