Browse Source

HUE-9485 [frontend] Rename the Link component to HueLink to prevent conflict with existing HTML tag

Johan Ahlen 5 năm trước cách đây
mục cha
commit
5be112340c

+ 5 - 5
desktop/core/src/desktop/js/components/Link.test.ts → desktop/core/src/desktop/js/components/HueLink.test.ts

@@ -15,16 +15,16 @@
 // limitations under the License.
 
 import { shallowMount } from '@vue/test-utils';
-import Link from './Link.vue';
+import HueLink from './HueLink.vue';
 
-describe('Link.vue', () => {
+describe('HueLink.vue', () => {
   it('should render a Link', () => {
-    const wrapper = shallowMount(Link);
+    const wrapper = shallowMount(HueLink);
     expect(wrapper.element).toMatchSnapshot();
   });
 
   it('should pass attributes to the a element', () => {
-    const wrapper = shallowMount(Link, {
+    const wrapper = shallowMount(HueLink, {
       attrs: {
         target: '_blank'
       }
@@ -33,7 +33,7 @@ describe('Link.vue', () => {
   });
 
   it('should not pass href attribute to the a element', () => {
-    const wrapper = shallowMount(Link, {
+    const wrapper = shallowMount(HueLink, {
       attrs: {
         href: 'http://gethue.com'
       }

+ 1 - 1
desktop/core/src/desktop/js/components/Link.vue → desktop/core/src/desktop/js/components/HueLink.vue

@@ -31,7 +31,7 @@
   }
 
   @Component
-  export default class Link extends Vue {
+  export default class HueLink extends Vue {
     @Prop({ required: false })
     url?: string;
 

+ 1 - 1
desktop/core/src/desktop/js/components/HumanByteSize.vue

@@ -43,7 +43,7 @@
   };
 
   @Component
-  export default class TimeAgo extends Vue {
+  export default class HumanByteSize extends Vue {
     @Prop({ required: false })
     value?: number;
 

+ 20 - 0
desktop/core/src/desktop/js/components/__snapshots__/HueLink.test.ts.snap

@@ -0,0 +1,20 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`HueLink.vue should not pass href attribute to the a element 1`] = `
+<a
+  href="javsscript:void(0);"
+/>
+`;
+
+exports[`HueLink.vue should pass attributes to the a element 1`] = `
+<a
+  href="javsscript:void(0);"
+  target="_blank"
+/>
+`;
+
+exports[`HueLink.vue should render a Link 1`] = `
+<a
+  href="javsscript:void(0);"
+/>
+`;

+ 0 - 20
desktop/core/src/desktop/js/components/__snapshots__/Link.test.ts.snap

@@ -1,20 +0,0 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
-
-exports[`Link.vue should not pass href attribute to the a element 1`] = `
-<a
-  href="javsscript:void(0);"
-/>
-`;
-
-exports[`Link.vue should pass attributes to the a element 1`] = `
-<a
-  href="javsscript:void(0);"
-  target="_blank"
-/>
-`;
-
-exports[`Link.vue should render a Link 1`] = `
-<a
-  href="javsscript:void(0);"
-/>
-`;