import Ember from 'ember';

const { computed, get } = Ember;

/*
 * Overriding href property to accomodate fragments.
 * https://github.com/emberjs/ember.js/blob/8c0eb283dae5dbdd0af4db585def294f9a289996/packages/ember-htmlbars/lib/components/link-to.js#L705-L716
 */
export default {
  name: 'extend-link-component',

  initialize() {
    Ember.LinkComponent.reopen({
      href: computed('models', 'qualifiedRouteName', function computeLinkToComponentHref() {
        if (get(this, 'tagName') !== 'a') { return; }

        let qualifiedRouteName = get(this, 'qualifiedRouteName');
        let models = get(this, 'models');

        if (get(this, 'loading')) { return get(this, 'loadingHref'); }

        let routing = get(this, '_routing');
        let queryParams = get(this, 'queryParams.values');
        const url = routing.generateURL(qualifiedRouteName, models, queryParams);
        const fragment = get(this, 'fragment');

        if (fragment) return `${url}#${fragment}`;
        return url;
      })
    });
  }
}

@@ -413,16 +413,24 @@
 teName',
+%0A       
  functio
@@ -462,32 +462,34 @@
 ref() %7B%0A        
+ 
+ 
 if (get(this, 't
@@ -514,16 +514,21 @@
 %7B return
+ null
 ; %7D%0A%0A   
@@ -528,26 +528,30 @@
  %7D%0A%0A        
-le
+  cons
 t qualifiedR
@@ -602,18 +602,22 @@
         
-le
+  cons
 t models
@@ -637,24 +637,26 @@
 'models');%0A%0A
+  
         if (
@@ -723,18 +723,22 @@
         
-le
+  cons
 t routin
@@ -776,10 +776,14 @@
     
-le
+  cons
 t qu
@@ -831,24 +831,26 @@
 ');%0A        
+  
 const url = 
@@ -848,16 +848,28 @@
 st url =
+%0A           
  routing
@@ -927,24 +927,26 @@
 s);%0A        
+  
 const fragme
@@ -970,24 +970,26 @@
 ragment');%0A%0A
+  
         if (
@@ -1035,16 +1035,18 @@
         
+  
 return u
@@ -1049,16 +1049,18 @@
 rn url;%0A
+  
       %7D)
@@ -1073,9 +1073,10 @@
 );%0A  %7D%0A%7D
+;
 %0A

Fix tests