@@ -94,22 +94,13 @@ describe('vue-loader', function () {
9494 entry : './test/fixtures/scoped-css.js'
9595 } , function ( window ) {
9696 var module = window . testModule
97- var cls = '.v-' + hash ( require . resolve ( './fixtures/scoped-css.vue' ) )
9897 expect ( module . template ) . to . contain (
99- '<div class="' + cls . slice ( 1 ) + ' "><h1>hi</h1></div>\n' +
100- '<p class="abc def ' + cls . slice ( 1 ) + ' ">hi</p>'
98+ '<div _v-1=" "><h1 _v-1="" >hi</h1></div>\n' +
99+ '<p class="abc def" _v-1=" ">hi</p>'
101100 )
102101 var style = window . document . querySelector ( 'style' ) . textContent
103- // lift selectors that start with body
104- expect ( style ) . to . contain ( 'body {\n color: yellow;\n}' )
105- expect ( style ) . not . to . contain ( cls + ' body' )
106- expect ( style ) . to . contain ( cls + ' h2 {\n color: yellow;\n}' )
107- // lift and replace :scope inside compound selectors
108- expect ( style ) . to . contain ( '\ndiv' + cls + '.test {\n color: blue;\n}' )
109- // lift :scope
110- expect ( style ) . to . contain ( '\n' + cls + ' {\n color: red;\n}' )
111- // nest normal selectors
112- expect ( style ) . to . contain ( '\n' + cls + ' h1 {\n color: green;\n}' )
102+ expect ( style ) . to . contain ( '.test[_v-1] {\n color: yellow;\n}' )
103+ expect ( style ) . to . contain ( 'h1[_v-1] {\n color: green;\n}' )
113104 done ( )
114105 } )
115106 } )
@@ -121,8 +112,7 @@ describe('vue-loader', function () {
121112 var styles = window . document . querySelectorAll ( 'style' )
122113 expect ( styles [ 0 ] . textContent ) . to . contain ( 'h1 { color: red; }' )
123114 // import with scoped
124- var cls = '.v-' + hash ( require . resolve ( './fixtures/import-scoped.css' ) )
125- expect ( styles [ 1 ] . textContent ) . to . contain ( cls + ' h1 {\n color: green;\n}' )
115+ expect ( styles [ 1 ] . textContent ) . to . contain ( 'h1[_v-2] { color: green; }' )
126116 done ( )
127117 } )
128118 } )
0 commit comments