@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.
- package/dist/front-mfe-components.common.js +26 -27
- package/dist/front-mfe-components.common.js.map +1 -1
- package/dist/front-mfe-components.css +1 -1
- package/dist/front-mfe-components.umd.js +26 -27
- package/dist/front-mfe-components.umd.js.map +1 -1
- package/dist/front-mfe-components.umd.min.js +1 -1
- package/dist/front-mfe-components.umd.min.js.map +1 -1
- package/package.json +1 -1
- package/src/components/Buttons/ConfirmButton/ConfirmButton.stories.js +10 -10
- package/src/components/Buttons/DefaultButton/__tests__/DefaultButton.spec.js +1 -1
- package/src/components/DialogFooter/DialogFooter.scss +1 -1
- package/src/components/DialogFooter/__tests__/{DialogFooter.spec.js → DialogFooter.spec.ts} +1 -1
- package/src/components/Typography/OverlayText/OverlayText.vue +0 -1
- package/src/components/Typography/Typography.vue +0 -1
- package/src/components/Typography/__tests__/{Typography.spec.js → Typography.spec.ts} +5 -5
- package/src/components/ValueCaption/ValueCaption.stories.js +24 -0
- package/src/components/ValueCaption/ValueCaption.vue +2 -2
- package/src/components/ValueCaption/__tests__/ValueCaption.spec.ts +31 -0
- package/src/components/ValueCaption/__tests__/ValueCaption.spec.js +0 -15
- /package/src/components/Typography/BodyText/__tests__/{BodyText.spec.js → BodyText.spec.ts} +0 -0
- /package/src/components/Typography/Caption/__tests__/{Caption.spec.js → Caption.spec.ts} +0 -0
- /package/src/components/Typography/Heading/__tests__/{Heading.spec.js → Heading.spec.ts} +0 -0
- /package/src/components/Typography/OverlayText/__tests__/{OverlayText.spec.js → OverlayText.spec.ts} +0 -0
- /package/src/components/Typography/Small/__tests__/{Small.spec.js → Small.spec.ts} +0 -0
- /package/src/components/Typography/Subtitle/__tests__/{Subtitle.spec.js → Subtitle.spec.ts} +0 -0
package/package.json
CHANGED
|
@@ -14,15 +14,15 @@ export default {
|
|
|
14
14
|
};
|
|
15
15
|
|
|
16
16
|
export const Primary = () => ({
|
|
17
|
-
template: '<
|
|
17
|
+
template: '<farm-btn-confirm>Confirm Button</farm-btn-confirm>',
|
|
18
18
|
});
|
|
19
19
|
|
|
20
20
|
export const HtmlMarkup = () => ({
|
|
21
|
-
template: '<
|
|
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: '<
|
|
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
|
-
<
|
|
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: `<
|
|
41
|
-
<
|
|
42
|
-
<
|
|
43
|
-
<
|
|
44
|
-
<
|
|
45
|
-
</
|
|
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
|
|
23
|
+
it('get isRound truthy', async () => {
|
|
24
24
|
await wrapper.setProps({ icon: true });
|
|
25
25
|
expect(component.isRound).toBeTruthy();
|
|
26
26
|
});
|
|
@@ -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',
|
|
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',
|
|
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',
|
|
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
|
-
});
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/src/components/Typography/OverlayText/__tests__/{OverlayText.spec.js → OverlayText.spec.ts}
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|