/*global describe, it*/
var expect = require('../unexpected-with-plugins'),
    _ = require('lodash'),
    AssetGraph = require('../../lib/AssetGraph');

describe('relations/HtmlPictureSource test', function () {
    it('should handle a test case with an existing <picture><source src="..."></picture> construct', function (done) {
        new AssetGraph({root: __dirname + '/../../testdata/relations/HtmlPictureSource/'})
            .loadAssets('index.html')
            .populate({
                followRelations: function () {return false;}
            })
            .queue(function (assetGraph) {
                expect(assetGraph, 'to contain relations including unresolved', 'HtmlPictureSource', 2);
                assetGraph.findAssets({type: 'Html'})[0].url = 'http://example.com/foo/bar.html';
                assetGraph.findRelations({}, true).forEach(function (relation) {
                    relation.hrefType = 'relative';
                });
                expect(_.map(assetGraph.findRelations({}, true), 'href'), 'to equal', [
                    '../image.png',
                    '../otherImage.jpg'
                ]);
            })
            .run(done);
    });
});

@@ -21,11 +21,13 @@
 t*/%0A
-var
+const
  exp
@@ -69,21 +69,23 @@
 lugins')
-,%0A   
+;%0Aconst
  _ = req
@@ -98,21 +98,23 @@
 lodash')
-,%0A   
+;%0Aconst
  AssetGr
@@ -312,16 +312,22 @@
 struct',
+ async
  functio
@@ -329,20 +329,16 @@
 nction (
-done
 ) %7B%0A    
@@ -341,16 +341,41 @@
         
+const assetGraph = await 
 new Asse
@@ -531,52 +531,41 @@
     
-followRelations: function () %7Breturn false;%7D
+startAssets: %7B isInitial: true %7D,
 %0A   
@@ -565,39 +565,32 @@
  %7D,%0A        
-    %7D)%0A
         
     .queue(f
@@ -581,51 +581,54 @@
     
-    .queue(function (assetGraph) %7B%0A        
+followRelations: () =%3E false%0A            %7D);%0A%0A
     
@@ -724,32 +724,24 @@
 2);%0A        
- 
-       
 assetGraph.f
@@ -810,24 +810,16 @@
 .html';%0A
-        
         
@@ -895,24 +895,16 @@
         
-  
-      
 relation
@@ -927,24 +927,16 @@
 ative';%0A
-        
         
@@ -947,24 +947,16 @@
         
-   
-     
 expect(_
@@ -1027,32 +1027,24 @@
             
-        
 '../image.pn
@@ -1055,32 +1055,24 @@
             
-    
-    
 '../otherIma
@@ -1091,56 +1091,9 @@
     
-        %5D);%0A            %7D)%0A            .run(done
+%5D
 );%0A 

Fix HtmlPictureSource test, 25 failing [ci skip]