@@ -41,6 +41,7 @@ define(function (require, exports, module) {
4141 var extensionPath = FileUtils . getNativeModuleDirectoryPath ( module ) ,
4242 testHtmlPath = extensionPath + "/testfiles/test.html" ,
4343 testCssPath = extensionPath + "/testfiles/subfolder/test.css" ,
44+ testScssPath = extensionPath + "/testfiles/subfolder/test.scss" ,
4445 testDocument ,
4546 testEditor ,
4647 hintsObj ;
@@ -50,7 +51,7 @@ define(function (require, exports, module) {
5051 // strategically so that they sort the same on all OS's (i.e. folders are listed
5152 // first, and then files), but this is not true for UrlCodeHints folder.
5253 var testfilesDirHints = [ "subfolder/" , "test.html" ] ,
53- subfolderDirHints = [ "chevron.png" , "test.css" , "test.js" ] ,
54+ subfolderDirHints = [ "chevron.png" , "test.css" , "test.js" , "test.scss" ] ,
5455 UrlCodeHintsDirHintsMac = [ "../data.json" , "../main.js" , "../testfiles/" , "../unittests.js" ] ,
5556 UrlCodeHintsDirHints = [ "../testfiles/" , "../data.json" , "../main.js" , "../unittests.js" ] ;
5657
@@ -269,15 +270,15 @@ define(function (require, exports, module) {
269270
270271 describe ( "Url Code Hints in a subfolder" , function ( ) {
271272
272- beforeFirst ( function ( ) {
273- setupTests ( testCssPath ) ;
274- } ) ;
275-
276- afterLast ( function ( ) {
273+ afterEach ( function ( ) {
277274 tearDownTests ( ) ;
278275 } ) ;
279276
280- it ( "should hint for background-image: url()" , function ( ) {
277+ it ( "should hint for background-image: url() in CSS" , function ( ) {
278+ runs ( function ( ) {
279+ setupTests ( testCssPath ) ;
280+ } ) ;
281+
281282 runs ( function ( ) {
282283 testEditor . setCursorPos ( { line : 3 , ch : 26 } ) ;
283284 hintsObj = null ;
@@ -288,6 +289,22 @@ define(function (require, exports, module) {
288289 verifyUrlHints ( hintsObj . hints , subfolderDirHints ) ;
289290 } ) ;
290291 } ) ;
292+
293+ it ( "should hint for background-image: url() in SCSS" , function ( ) {
294+ runs ( function ( ) {
295+ setupTests ( testScssPath ) ;
296+ } ) ;
297+
298+ runs ( function ( ) {
299+ testEditor . setCursorPos ( { line : 4 , ch : 34 } ) ;
300+ hintsObj = null ;
301+ expectAsyncHints ( UrlCodeHints . hintProvider ) ;
302+ } ) ;
303+
304+ runs ( function ( ) {
305+ verifyUrlHints ( hintsObj . hints , subfolderDirHints ) ;
306+ } ) ;
307+ } ) ;
291308 } ) ;
292309
293310 describe ( "Project root relative Url Code Hints" , function ( ) {
@@ -471,7 +488,7 @@ define(function (require, exports, module) {
471488 runs ( function ( ) {
472489 expect ( hintsObj ) . toBeTruthy ( ) ;
473490 expect ( hintsObj . hints ) . toBeTruthy ( ) ;
474- expect ( hintsObj . hints . length ) . toBe ( 3 ) ;
491+ expect ( hintsObj . hints . length ) . toBe ( subfolderDirHints . length ) ;
475492
476493 // Complete path is displayed
477494 expect ( hintsObj . hints [ 0 ] ) . toBe ( "subfolder/chevron.png" ) ;
@@ -526,7 +543,7 @@ define(function (require, exports, module) {
526543 runs ( function ( ) {
527544 expect ( hintsObj ) . toBeTruthy ( ) ;
528545 expect ( hintsObj . hints ) . toBeTruthy ( ) ;
529- expect ( hintsObj . hints . length ) . toBe ( 3 ) ;
546+ expect ( hintsObj . hints . length ) . toBe ( subfolderDirHints . length ) ;
530547
531548 // Complete path is displayed
532549 expect ( hintsObj . hints [ 0 ] ) . toBe ( "subfolder/chevron.png" ) ;
@@ -578,7 +595,7 @@ define(function (require, exports, module) {
578595 runs ( function ( ) {
579596 expect ( hintsObj ) . toBeTruthy ( ) ;
580597 expect ( hintsObj . hints ) . toBeTruthy ( ) ;
581- expect ( hintsObj . hints . length ) . toBe ( 3 ) ;
598+ expect ( hintsObj . hints . length ) . toBe ( subfolderDirHints . length ) ;
582599
583600 // Complete path is displayed
584601 expect ( hintsObj . hints [ 0 ] ) . toBe ( "subfolder/chevron.png" ) ;
@@ -675,7 +692,7 @@ define(function (require, exports, module) {
675692 runs ( function ( ) {
676693 expect ( hintsObj ) . toBeTruthy ( ) ;
677694 expect ( hintsObj . hints ) . toBeTruthy ( ) ;
678- expect ( hintsObj . hints . length ) . toBe ( 3 ) ;
695+ expect ( hintsObj . hints . length ) . toBe ( subfolderDirHints . length ) ;
679696
680697 // Complete path is displayed
681698 expect ( hintsObj . hints [ 0 ] ) . toBe ( "subfolder/chevron.png" ) ;
0 commit comments