@farm-investimentos/front-mfe-components-vue3 1.0.1 → 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (25) hide show
  1. package/dist/front-mfe-components.common.js +26 -27
  2. package/dist/front-mfe-components.common.js.map +1 -1
  3. package/dist/front-mfe-components.css +1 -1
  4. package/dist/front-mfe-components.umd.js +26 -27
  5. package/dist/front-mfe-components.umd.js.map +1 -1
  6. package/dist/front-mfe-components.umd.min.js +1 -1
  7. package/dist/front-mfe-components.umd.min.js.map +1 -1
  8. package/package.json +1 -1
  9. package/src/components/Buttons/ConfirmButton/ConfirmButton.stories.js +10 -10
  10. package/src/components/Buttons/DefaultButton/__tests__/DefaultButton.spec.js +1 -1
  11. package/src/components/DialogFooter/DialogFooter.scss +1 -1
  12. package/src/components/DialogFooter/__tests__/{DialogFooter.spec.js → DialogFooter.spec.ts} +1 -1
  13. package/src/components/Typography/OverlayText/OverlayText.vue +0 -1
  14. package/src/components/Typography/Typography.vue +0 -1
  15. package/src/components/Typography/__tests__/{Typography.spec.js → Typography.spec.ts} +5 -5
  16. package/src/components/ValueCaption/ValueCaption.stories.js +24 -0
  17. package/src/components/ValueCaption/ValueCaption.vue +2 -2
  18. package/src/components/ValueCaption/__tests__/ValueCaption.spec.ts +31 -0
  19. package/src/components/ValueCaption/__tests__/ValueCaption.spec.js +0 -15
  20. /package/src/components/Typography/BodyText/__tests__/{BodyText.spec.js → BodyText.spec.ts} +0 -0
  21. /package/src/components/Typography/Caption/__tests__/{Caption.spec.js → Caption.spec.ts} +0 -0
  22. /package/src/components/Typography/Heading/__tests__/{Heading.spec.js → Heading.spec.ts} +0 -0
  23. /package/src/components/Typography/OverlayText/__tests__/{OverlayText.spec.js → OverlayText.spec.ts} +0 -0
  24. /package/src/components/Typography/Small/__tests__/{Small.spec.js → Small.spec.ts} +0 -0
  25. /package/src/components/Typography/Subtitle/__tests__/{Subtitle.spec.js → Subtitle.spec.ts} +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@farm-investimentos/front-mfe-components-vue3",
3
- "version": "1.0.1",
3
+ "version": "1.0.3",
4
4
  "private": false,
5
5
  "repository": {
6
6
  "type": "git",
@@ -14,15 +14,15 @@ export default {
14
14
  };
15
15
 
16
16
  export const Primary = () => ({
17
- template: '<ConfirmButton>Confirm Button</ConfirmButton>',
17
+ template: '<farm-btn-confirm>Confirm Button</farm-btn-confirm>',
18
18
  });
19
19
 
20
20
  export const HtmlMarkup = () => ({
21
- template: '<ConfirmButton><em>I am italic</strong></em></ConfirmButton>',
21
+ template: '<farm-btn-confirm><em>I am italic</strong></em></farm-btn-confirm>',
22
22
  });
23
23
 
24
24
  export const Props = () => ({
25
- template: '<ConfirmButton title="custom title">custom title (hover me)</ConfirmButton>',
25
+ template: '<farm-btn-confirm title="custom title">custom title (hover me)</farm-btn-confirm>',
26
26
  });
27
27
 
28
28
  export const Listener = () => ({
@@ -32,15 +32,15 @@ export const Listener = () => ({
32
32
  };
33
33
  },
34
34
  template: `
35
- <ConfirmButton color="error" @click="x = x + 1">click me to change: {{ x }}</ConfirmButton>
35
+ <farm-btn-confirm color="error" @click="x = x + 1">click me to change: {{ x }}</farm-btn-confirm>
36
36
  `,
37
37
  });
38
38
 
39
39
  export const Iconed = () => ({
40
- template: `<div>
41
- <ConfirmButton :icon="true">default icon</ConfirmButton>
42
- <ConfirmButton :icon="true" customIcon="information-outline">information-outline</ConfirmButton>
43
- <ConfirmButton :icon="true" customIcon="account-search">account-search</ConfirmButton>
44
- <ConfirmButton :icon="true" customIcon="account-search" disabled>account-search</ConfirmButton>
45
- </div>`,
40
+ template: `<farm-box>
41
+ <farm-btn-confirm :icon="true">default icon</farm-btn-confirm>
42
+ <farm-btn-confirm :icon="true" customIcon="information-outline">information-outline</farm-btn-confirm>
43
+ <farm-btn-confirm :icon="true" customIcon="account-search">account-search</farm-btn-confirm>
44
+ <farm-btn-confirm :icon="true" customIcon="account-search" disabled>account-search</farm-btn-confirm>
45
+ </farm-box>`,
46
46
  });
@@ -20,7 +20,7 @@ describe('DefaultButton component', () => {
20
20
  expect(component.isRound).toBeFalsy();
21
21
  });
22
22
 
23
- it('get isRound false', async () => {
23
+ it('get isRound truthy', async () => {
24
24
  await wrapper.setProps({ icon: true });
25
25
  expect(component.isRound).toBeTruthy();
26
26
  });
@@ -10,7 +10,7 @@
10
10
  }
11
11
 
12
12
  .farm-btn {
13
- margin-left: gutter('none');
13
+ margin-left: gutter('sm');
14
14
  margin-top: 0;
15
15
 
16
16
  .farm-icon {
@@ -1,6 +1,6 @@
1
1
  import { shallowMount } from '@vue/test-utils';
2
2
 
3
- import DialogFooter from '../DialogFooter';
3
+ import DialogFooter from '../DialogFooter.vue';
4
4
 
5
5
  describe('DialogFooter component', () => {
6
6
  let wrapper;
@@ -11,7 +11,6 @@
11
11
  </template>
12
12
  <script lang="ts">
13
13
 
14
-
15
14
  export default {
16
15
  inheritAttrs: true,
17
16
  name: 'farm-overlaytext',
@@ -119,7 +119,6 @@ export default {
119
119
  style.value.lineHeight = lineHeight.value;
120
120
  }
121
121
 
122
- // eslint-disable-next-line
123
122
  return {
124
123
  style,
125
124
  isSizeFromBreakpoints,
@@ -1,6 +1,6 @@
1
1
  import { shallowMount } from '@vue/test-utils';
2
2
 
3
- import Typography from '../Typography';
3
+ import Typography from '../Typography.vue';
4
4
 
5
5
  describe('Typography component', () => {
6
6
  let wrapper;
@@ -30,7 +30,7 @@ describe('Typography component', () => {
30
30
  expect(component.isSizeFromBreakpoints).toBeFalsy();
31
31
  });
32
32
 
33
- it('Should have isSizeFromBreakpoints truthy', async () => {
33
+ it('Should have isSizeFromBreakpoints truthy', () => {
34
34
  const wrapperTest = shallowMount(Typography, {
35
35
  propsData: {
36
36
  size: 'lg',
@@ -45,14 +45,14 @@ describe('Typography component', () => {
45
45
  });
46
46
 
47
47
  describe('Prop data', () => {
48
- it('Should have li tag', async () => {
48
+ it('Should have li tag', () => {
49
49
  expect(component.tag).toEqual('li');
50
50
  });
51
51
 
52
- it('Should not allow invalid html tag', async () => {
52
+ it('Should not allow invalid html tag', () => {
53
53
  const wrapperTest = shallowMount(Typography, {
54
54
  propsData: {
55
- tag: 'section',
55
+ tag: 'section' as any,
56
56
  },
57
57
  });
58
58
  expect(wrapperTest.vm.tag).toEqual('p');
@@ -58,3 +58,27 @@ export const Colors = () => ({
58
58
  </farm-valuecaption>
59
59
  </div>`,
60
60
  });
61
+
62
+ export const NoTitle = () => ({
63
+ template: `
64
+ <farm-valuecaption
65
+ icon="account-box-outline"
66
+ >
67
+ <template v-slot:subtitle>
68
+ R$ 1.000,00
69
+ </template>
70
+ </farm-valuecaption>
71
+ `,
72
+ });
73
+
74
+ export const NoSubTitle = () => ({
75
+ template: `
76
+ <farm-valuecaption
77
+ icon="account-box-outline"
78
+ >
79
+ <template v-slot:title>
80
+ Upper Line Text
81
+ </template>
82
+ </farm-valuecaption>
83
+ `,
84
+ });
@@ -50,8 +50,8 @@ export default {
50
50
  },
51
51
 
52
52
  setup(_, { slots }) {
53
- const hasTitle = computed(() => slots.title);
54
- const hasSubtitle = computed(() => slots.subtitle);
53
+ const hasTitle = computed(() => !!slots.title);
54
+ const hasSubtitle = computed(() => !!slots.subtitle);
55
55
 
56
56
  return { hasSubtitle, hasTitle };
57
57
  },
@@ -0,0 +1,31 @@
1
+ import { shallowMount } from '@vue/test-utils';
2
+
3
+ import ValueCaption from '../ValueCaption.vue';
4
+
5
+ describe('ValueCaption component', () => {
6
+ test('Created hook', () => {
7
+ const wrapper = shallowMount(ValueCaption);
8
+ expect(wrapper).toBeDefined();
9
+ expect(wrapper.vm.hasTitle).toBeFalsy();
10
+ });
11
+
12
+ describe('Computed properties', () => {
13
+ it('hasTitle truthy', () => {
14
+ const wrapper = shallowMount(ValueCaption, {
15
+ slots: {
16
+ title: '',
17
+ },
18
+ });
19
+ expect(wrapper.vm.hasTitle).toBeTruthy();
20
+ });
21
+
22
+ it('hasSubtitle truthy', () => {
23
+ const wrapper = shallowMount(ValueCaption, {
24
+ slots: {
25
+ subtitle: '',
26
+ },
27
+ });
28
+ expect(wrapper.vm.hasSubtitle).toBeTruthy();
29
+ });
30
+ });
31
+ });
@@ -1,15 +0,0 @@
1
- import { shallowMount } from '@vue/test-utils';
2
-
3
- import ValueCaption from '../ValueCaption.vue';
4
-
5
- describe('ValueCaption component', () => {
6
- let wrapper;
7
-
8
- beforeEach(() => {
9
- wrapper = shallowMount(ValueCaption);
10
- });
11
-
12
- test('Created hook', () => {
13
- expect(wrapper).toBeDefined();
14
- });
15
- });