@bimdata/design-system 2.0.0-rc.19 → 2.0.0-rc.20
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/package.json +1 -2
- package/src/BIMDataComponents/BIMDataBigSpinner/BIMDataBigSpinner.vue +1 -4
- package/src/BIMDataComponents/BIMDataBigSpinner/_BIMDataBigSpinner.scss +2 -0
- package/src/BIMDataComponents/BIMDataBreadcrumb/BIMDataBreadcrumb.vue +1 -1
- package/src/BIMDataComponents/BIMDataButton/BIMDataButton.vue +1 -6
- package/src/BIMDataComponents/BIMDataButton/_BIMDataButton.scss +1 -0
- package/src/BIMDataComponents/BIMDataCard/BIMDataCard.vue +1 -6
- package/src/BIMDataComponents/BIMDataCard/BIMDataCardBand.vue +1 -3
- package/src/BIMDataComponents/BIMDataCard/_BIMDataCard.scss +1 -0
- package/src/BIMDataComponents/BIMDataCheckbox/BIMDataCheckbox.vue +1 -6
- package/src/BIMDataComponents/BIMDataCheckbox/_BIMDataCheckbox.scss +1 -1
- package/src/BIMDataComponents/BIMDataDatePicker/BIMDataDatePicker.vue +1 -7
- package/src/BIMDataComponents/BIMDataDatePicker/_BIMDataDatePicker.scss +0 -1
- package/src/BIMDataComponents/BIMDataDropdownList/BIMDataDropdownList.vue +1 -3
- package/src/BIMDataComponents/BIMDataDropdownList/_BIMDataDropdownList.scss +0 -3
- package/src/BIMDataComponents/BIMDataDropdownMenu/BIMDataDropdownMenu.vue +1 -7
- package/src/BIMDataComponents/BIMDataDropdownMenu/_BIMDataDropdownMenu.scss +0 -3
- package/src/BIMDataComponents/BIMDataIcon/BIMDataIcon.vue +1 -3
- package/src/BIMDataComponents/BIMDataIcon/BIMDataIconStandalone/BIMDataIconChevron.vue +1 -3
- package/src/BIMDataComponents/BIMDataIcon/BIMDataIconStandalone/BIMDataIconClose.vue +1 -3
- package/src/BIMDataComponents/BIMDataIcon/BIMDataIconStandalone/BIMDataIconDoubleChevron.vue +1 -3
- package/src/BIMDataComponents/BIMDataIcon/BIMDataIconStandalone/BIMDataIconSearch.vue +1 -3
- package/src/BIMDataComponents/BIMDataIllustration/BIMDataIllustration.vue +0 -6
- package/src/BIMDataComponents/BIMDataInput/BIMDataInput.vue +1 -6
- package/src/BIMDataComponents/BIMDataInput/_BIMDataInput.scss +1 -2
- package/src/BIMDataComponents/BIMDataLoading/BIMDataLoading.vue +1 -3
- package/src/BIMDataComponents/BIMDataLoading/_BIMDataLoading.scss +1 -0
- package/src/BIMDataComponents/BIMDataMenu/BIMDataMenu.vue +1 -1
- package/src/BIMDataComponents/BIMDataMenuInline/BIMDataMenuInline.vue +1 -1
- package/src/BIMDataComponents/BIMDataNavigation/BIMDataNavigation.vue +0 -5
- package/src/BIMDataComponents/BIMDataPDFViewer/BIMDataPDFViewer.vue +0 -3
- package/src/BIMDataComponents/BIMDataPaginatedList/BIMDataPaginatedList.vue +0 -5
- package/src/BIMDataComponents/BIMDataPagination/BIMDataPagination.vue +0 -2
- package/src/BIMDataComponents/BIMDataPieSpinner/BIMDataPieSpinner.vue +1 -3
- package/src/BIMDataComponents/BIMDataRadio/BIMDataRadio.vue +1 -6
- package/src/BIMDataComponents/BIMDataRadio/_BIMDataRadio.scss +1 -0
- package/src/BIMDataComponents/BIMDataSearch/BIMDataSearch.vue +1 -6
- package/src/BIMDataComponents/BIMDataSearch/_BIMDataSearch.scss +1 -0
- package/src/BIMDataComponents/BIMDataSearchAutocomplete/BIMDataSearchAutocomplete.vue +1 -1
- package/src/BIMDataComponents/BIMDataSelect/BIMDataSelect.scss +0 -1
- package/src/BIMDataComponents/BIMDataSpinner/BIMDataSpinner.vue +1 -3
- package/src/BIMDataComponents/BIMDataSpinner/_BIMDataSpinner.scss +1 -0
- package/src/BIMDataComponents/BIMDataTable/_BIMDataTable.scss +0 -2
- package/src/BIMDataComponents/BIMDataTabs/BIMDataTabs.vue +1 -4
- package/src/BIMDataComponents/BIMDataTextarea/BIMDataTextarea.vue +1 -6
- package/src/BIMDataComponents/BIMDataTextarea/_BIMDataTextarea.scss +0 -1
- package/src/BIMDataComponents/BIMDataTextbox/BIMDataTextbox.vue +1 -4
- package/src/BIMDataComponents/BIMDataToggle/BIMDataToggle.vue +1 -3
- package/src/BIMDataComponents/BIMDataTooltip/BIMDataTooltip.vue +1 -1
- package/src/BIMDataComponents/BIMDataTooltip/_BIMDataTooltip.scss +0 -2
- package/src/BIMDataSmartComponents/BIMDataFileManager/BIMDataFileManager.scss +0 -2
- package/src/BIMDataSmartComponents/BIMDataFileManager/components/FileCard.vue +0 -2
- package/src/BIMDataSmartComponents/BIMDataFileManager/components/MultiLineTextBox/MultiLineTextBox.vue +2 -4
- package/src/BIMDataSmartComponents/BIMDataFileManager/components/MultiLineTextBox/Tooltip.vue +1 -1
- package/src/BIMDataSmartComponents/BIMDataFileManager/components/PieProgressSpinner.vue +2 -2
- package/src/BIMDataSmartComponents/BIMDataFileManager/components/modals/DeleteModal.vue +0 -3
- package/src/BIMDataSmartComponents/BIMDataFileManager/components/modals/RenameModal.vue +0 -3
- package/src/BIMDataSmartComponents/BIMDataFileManager/components/newFolder/NewFolderButton.vue +0 -3
- package/src/BIMDataSmartComponents/BIMDataFileManager/components/newFolder/NewFolderForm.vue +0 -3
- package/src/assets/css/fonts.css +1 -1
- package/src/assets/scss/mixins/_font-size.scss +3 -1
- package/src/BIMDataComponents/BIMDataBurgerMenu/BIMDataBurgerMenu.vue +0 -14
- package/src/BIMDataComponents/BIMDataButton/__tests__/BIMDataButton.test.js +0 -47
- package/src/BIMDataComponents/BIMDataButton/__tests__/__snapshots__/BIMDataButton.test.js.snap +0 -9
- package/src/BIMDataComponents/BIMDataCard/__tests__/BIMDataCard.test.js +0 -81
- package/src/BIMDataComponents/BIMDataCard/__tests__/__snapshots__/BIMDataCard.test.js.snap +0 -82
- package/src/BIMDataComponents/BIMDataCheckbox/__tests__/BIMDataCheckbox.test.js +0 -95
- package/src/BIMDataComponents/BIMDataCheckbox/__tests__/__snapshots__/BIMDataCheckbox.test.js.snap +0 -27
- package/src/BIMDataComponents/BIMDataInput/__tests__/BIMDataInput.test.js +0 -92
- package/src/BIMDataComponents/BIMDataInput/__tests__/__snapshots__/BIMDataInput.test.js.snap +0 -63
- package/src/BIMDataComponents/BIMDataNavigation/__tests__/BIMDataNavigation.test.js +0 -86
- package/src/BIMDataComponents/BIMDataNavigation/__tests__/__snapshots__/BIMDataNavigation.test.js.snap +0 -113
- package/src/BIMDataComponents/BIMDataTextarea/__tests__/BIMDataTextarea.test.js +0 -87
- package/src/BIMDataComponents/BIMDataTextarea/__tests__/__snapshots__/BIMDataTextarea.test.js.snap +0 -50
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { shallowMount } from "@vue/test-utils";
|
|
2
|
-
import BIMDataButton from "../BIMDataButton.vue";
|
|
3
|
-
|
|
4
|
-
describe("BIMDataButton", () => {
|
|
5
|
-
it("should render component and match snapshot", () => {
|
|
6
|
-
const wrapper = shallowMount(BIMDataButton);
|
|
7
|
-
expect(wrapper.html()).toMatchSnapshot();
|
|
8
|
-
});
|
|
9
|
-
|
|
10
|
-
it("should render a button with a slot and match snapshot", () => {
|
|
11
|
-
const wrapper = shallowMount(BIMDataButton, {
|
|
12
|
-
slots: {
|
|
13
|
-
default: "<span>test</span>",
|
|
14
|
-
},
|
|
15
|
-
});
|
|
16
|
-
expect(wrapper.html()).toMatchSnapshot();
|
|
17
|
-
});
|
|
18
|
-
|
|
19
|
-
it("should render a button with a custom width and match snapshot", () => {
|
|
20
|
-
const wrapper = shallowMount(BIMDataButton, {
|
|
21
|
-
propsData: {
|
|
22
|
-
width: "50px",
|
|
23
|
-
},
|
|
24
|
-
});
|
|
25
|
-
expect(wrapper.html()).toMatchSnapshot();
|
|
26
|
-
});
|
|
27
|
-
|
|
28
|
-
it("should render a button with a custom height and match snapshot", () => {
|
|
29
|
-
const wrapper = shallowMount(BIMDataButton, {
|
|
30
|
-
propsData: {
|
|
31
|
-
height: "50px",
|
|
32
|
-
},
|
|
33
|
-
});
|
|
34
|
-
expect(wrapper.html()).toMatchSnapshot();
|
|
35
|
-
});
|
|
36
|
-
|
|
37
|
-
it("should emit a click event", () => {
|
|
38
|
-
const onClick = jest.fn();
|
|
39
|
-
const wrapper = shallowMount(BIMDataButton, {
|
|
40
|
-
listeners: {
|
|
41
|
-
click: onClick,
|
|
42
|
-
},
|
|
43
|
-
});
|
|
44
|
-
wrapper.trigger("click");
|
|
45
|
-
expect(onClick).toHaveBeenCalled();
|
|
46
|
-
});
|
|
47
|
-
});
|
package/src/BIMDataComponents/BIMDataButton/__tests__/__snapshots__/BIMDataButton.test.js.snap
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
-
|
|
3
|
-
exports[`BIMDataButton should render a button with a custom height and match snapshot 1`] = `"<button color=\\"default\\" type=\\"button\\" class=\\"bimdata-btn\\" style=\\"min-width: 32px; min-height: 50px;\\"></button>"`;
|
|
4
|
-
|
|
5
|
-
exports[`BIMDataButton should render a button with a custom width and match snapshot 1`] = `"<button color=\\"default\\" type=\\"button\\" class=\\"bimdata-btn\\" style=\\"min-width: 50px; min-height: 32px;\\"></button>"`;
|
|
6
|
-
|
|
7
|
-
exports[`BIMDataButton should render a button with a slot and match snapshot 1`] = `"<button color=\\"default\\" type=\\"button\\" class=\\"bimdata-btn\\" style=\\"min-width: 32px; min-height: 32px;\\"><span>test</span></button>"`;
|
|
8
|
-
|
|
9
|
-
exports[`BIMDataButton should render component and match snapshot 1`] = `"<button color=\\"default\\" type=\\"button\\" class=\\"bimdata-btn\\" style=\\"min-width: 32px; min-height: 32px;\\"></button>"`;
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
import { shallowMount } from "@vue/test-utils";
|
|
2
|
-
import BIMDataCard from "../BIMDataCard.vue";
|
|
3
|
-
|
|
4
|
-
describe("BIMDataCard", () => {
|
|
5
|
-
it("should render component and match snapshot", () => {
|
|
6
|
-
const wrapper = shallowMount(BIMDataCard);
|
|
7
|
-
expect(wrapper.html()).toMatchSnapshot();
|
|
8
|
-
});
|
|
9
|
-
|
|
10
|
-
it("should render component with title header", () => {
|
|
11
|
-
const wrapper = shallowMount(BIMDataCard, {
|
|
12
|
-
propsData: {
|
|
13
|
-
titleHeader: "Hearder title card",
|
|
14
|
-
},
|
|
15
|
-
});
|
|
16
|
-
expect(wrapper.html()).toMatchSnapshot();
|
|
17
|
-
});
|
|
18
|
-
|
|
19
|
-
it("should render component with submenu text", () => {
|
|
20
|
-
const wrapper = shallowMount(BIMDataCard, {
|
|
21
|
-
propsData: {
|
|
22
|
-
submenuText: "Submenu text card",
|
|
23
|
-
},
|
|
24
|
-
});
|
|
25
|
-
expect(wrapper.html()).toMatchSnapshot();
|
|
26
|
-
});
|
|
27
|
-
|
|
28
|
-
it("should render component with a custom width", () => {
|
|
29
|
-
const wrapper = shallowMount(BIMDataCard, {
|
|
30
|
-
propsData: {
|
|
31
|
-
width: "350px",
|
|
32
|
-
},
|
|
33
|
-
});
|
|
34
|
-
expect(wrapper.html()).toMatchSnapshot();
|
|
35
|
-
});
|
|
36
|
-
|
|
37
|
-
it("should render a card with a headerIcons slot and match snapshot", () => {
|
|
38
|
-
const wrapper = shallowMount(BIMDataCard, {
|
|
39
|
-
slots: {
|
|
40
|
-
headerIcons: "<span>header icons slot</span>",
|
|
41
|
-
},
|
|
42
|
-
});
|
|
43
|
-
expect(wrapper.html()).toMatchSnapshot();
|
|
44
|
-
});
|
|
45
|
-
|
|
46
|
-
it("should render a card with a left slot and match snapshot", () => {
|
|
47
|
-
const wrapper = shallowMount(BIMDataCard, {
|
|
48
|
-
slots: {
|
|
49
|
-
left: "<span>left slot</span>",
|
|
50
|
-
},
|
|
51
|
-
});
|
|
52
|
-
expect(wrapper.html()).toMatchSnapshot();
|
|
53
|
-
});
|
|
54
|
-
|
|
55
|
-
it("should render a card with a left slot and match snapshot", () => {
|
|
56
|
-
const wrapper = shallowMount(BIMDataCard, {
|
|
57
|
-
slots: {
|
|
58
|
-
right: "<span>right slot</span>",
|
|
59
|
-
},
|
|
60
|
-
});
|
|
61
|
-
expect(wrapper.html()).toMatchSnapshot();
|
|
62
|
-
});
|
|
63
|
-
|
|
64
|
-
it("should render a card with a content slot and match snapshot", () => {
|
|
65
|
-
const wrapper = shallowMount(BIMDataCard, {
|
|
66
|
-
slots: {
|
|
67
|
-
content: "<span>content slot</span>",
|
|
68
|
-
},
|
|
69
|
-
});
|
|
70
|
-
expect(wrapper.html()).toMatchSnapshot();
|
|
71
|
-
});
|
|
72
|
-
|
|
73
|
-
it("should render a card with a footer slot and match snapshot", () => {
|
|
74
|
-
const wrapper = shallowMount(BIMDataCard, {
|
|
75
|
-
slots: {
|
|
76
|
-
footer: "<span>footer slot</span>",
|
|
77
|
-
},
|
|
78
|
-
});
|
|
79
|
-
expect(wrapper.html()).toMatchSnapshot();
|
|
80
|
-
});
|
|
81
|
-
});
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
-
|
|
3
|
-
exports[`BIMDataCard should render a card with a content slot and match snapshot 1`] = `
|
|
4
|
-
"<div class=\\"bimdata-card bimdata-card__default\\" style=\\"min-width: 215px; border-radius: 0px;\\">
|
|
5
|
-
<!---->
|
|
6
|
-
<!---->
|
|
7
|
-
<div class=\\"bimdata-card__content\\"><span>content slot</span></div>
|
|
8
|
-
<!---->
|
|
9
|
-
</div>"
|
|
10
|
-
`;
|
|
11
|
-
|
|
12
|
-
exports[`BIMDataCard should render a card with a footer slot and match snapshot 1`] = `
|
|
13
|
-
"<div class=\\"bimdata-card bimdata-card__default\\" style=\\"min-width: 215px; border-radius: 0px;\\">
|
|
14
|
-
<!---->
|
|
15
|
-
<!---->
|
|
16
|
-
<!---->
|
|
17
|
-
<footer class=\\"bimdata-card__footer\\"><span>footer slot</span></footer>
|
|
18
|
-
</div>"
|
|
19
|
-
`;
|
|
20
|
-
|
|
21
|
-
exports[`BIMDataCard should render a card with a headerIcons slot and match snapshot 1`] = `
|
|
22
|
-
"<div class=\\"bimdata-card bimdata-card__default\\" style=\\"min-width: 215px; border-radius: 0px;\\">
|
|
23
|
-
<bimdatacardband-stub class=\\"bimdata-card__header\\"></bimdatacardband-stub>
|
|
24
|
-
<!---->
|
|
25
|
-
<!---->
|
|
26
|
-
<!---->
|
|
27
|
-
</div>"
|
|
28
|
-
`;
|
|
29
|
-
|
|
30
|
-
exports[`BIMDataCard should render a card with a left slot and match snapshot 1`] = `
|
|
31
|
-
"<div class=\\"bimdata-card bimdata-card__default\\" style=\\"min-width: 215px; border-radius: 0px;\\">
|
|
32
|
-
<!---->
|
|
33
|
-
<bimdatacardband-stub class=\\"bimdata-card__submenu\\"></bimdatacardband-stub>
|
|
34
|
-
<!---->
|
|
35
|
-
<!---->
|
|
36
|
-
</div>"
|
|
37
|
-
`;
|
|
38
|
-
|
|
39
|
-
exports[`BIMDataCard should render a card with a left slot and match snapshot 2`] = `
|
|
40
|
-
"<div class=\\"bimdata-card bimdata-card__default\\" style=\\"min-width: 215px; border-radius: 0px;\\">
|
|
41
|
-
<!---->
|
|
42
|
-
<bimdatacardband-stub class=\\"bimdata-card__submenu\\"></bimdatacardband-stub>
|
|
43
|
-
<!---->
|
|
44
|
-
<!---->
|
|
45
|
-
</div>"
|
|
46
|
-
`;
|
|
47
|
-
|
|
48
|
-
exports[`BIMDataCard should render component and match snapshot 1`] = `
|
|
49
|
-
"<div class=\\"bimdata-card bimdata-card__default\\" style=\\"min-width: 215px; border-radius: 0px;\\">
|
|
50
|
-
<!---->
|
|
51
|
-
<!---->
|
|
52
|
-
<!---->
|
|
53
|
-
<!---->
|
|
54
|
-
</div>"
|
|
55
|
-
`;
|
|
56
|
-
|
|
57
|
-
exports[`BIMDataCard should render component with a custom width 1`] = `
|
|
58
|
-
"<div class=\\"bimdata-card bimdata-card__default\\" style=\\"min-width: 350px; border-radius: 0px;\\">
|
|
59
|
-
<!---->
|
|
60
|
-
<!---->
|
|
61
|
-
<!---->
|
|
62
|
-
<!---->
|
|
63
|
-
</div>"
|
|
64
|
-
`;
|
|
65
|
-
|
|
66
|
-
exports[`BIMDataCard should render component with submenu text 1`] = `
|
|
67
|
-
"<div class=\\"bimdata-card bimdata-card__default\\" style=\\"min-width: 215px; border-radius: 0px;\\">
|
|
68
|
-
<!---->
|
|
69
|
-
<bimdatacardband-stub text=\\"Submenu text card\\" class=\\"bimdata-card__submenu\\"></bimdatacardband-stub>
|
|
70
|
-
<!---->
|
|
71
|
-
<!---->
|
|
72
|
-
</div>"
|
|
73
|
-
`;
|
|
74
|
-
|
|
75
|
-
exports[`BIMDataCard should render component with title header 1`] = `
|
|
76
|
-
"<div class=\\"bimdata-card bimdata-card__default\\" style=\\"min-width: 215px; border-radius: 0px;\\">
|
|
77
|
-
<bimdatacardband-stub text=\\"Hearder title card\\" class=\\"bimdata-card__header\\"></bimdatacardband-stub>
|
|
78
|
-
<!---->
|
|
79
|
-
<!---->
|
|
80
|
-
<!---->
|
|
81
|
-
</div>"
|
|
82
|
-
`;
|
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
import { shallowMount } from "@vue/test-utils";
|
|
2
|
-
import BIMDataCheckbox from "../BIMDataCheckbox.vue";
|
|
3
|
-
|
|
4
|
-
describe("BIMDataCheckbox", () => {
|
|
5
|
-
it("should render component and match snapshot", () => {
|
|
6
|
-
const wrapper = shallowMount(BIMDataCheckbox, {
|
|
7
|
-
propsData: {
|
|
8
|
-
modelValue: false,
|
|
9
|
-
},
|
|
10
|
-
});
|
|
11
|
-
expect(wrapper.html()).toMatchSnapshot();
|
|
12
|
-
});
|
|
13
|
-
|
|
14
|
-
it("should render component with text and match snapshot", () => {
|
|
15
|
-
const wrapper = shallowMount(BIMDataCheckbox, {
|
|
16
|
-
propsData: {
|
|
17
|
-
modelValue: false,
|
|
18
|
-
text: "text checkbox",
|
|
19
|
-
},
|
|
20
|
-
});
|
|
21
|
-
expect(wrapper.html()).toMatchSnapshot();
|
|
22
|
-
});
|
|
23
|
-
|
|
24
|
-
it("should contain 'bimdata-checkbox' class when state false", () => {
|
|
25
|
-
const wrapper = shallowMount(BIMDataCheckbox, {
|
|
26
|
-
propsData: {
|
|
27
|
-
modelValue: false,
|
|
28
|
-
},
|
|
29
|
-
});
|
|
30
|
-
|
|
31
|
-
expect(wrapper.html()).toMatchSnapshot();
|
|
32
|
-
});
|
|
33
|
-
|
|
34
|
-
it("should contain 'bimdata-chekbox' and 'checked' class when state true", () => {
|
|
35
|
-
const wrapper = shallowMount(BIMDataCheckbox, {
|
|
36
|
-
propsData: {
|
|
37
|
-
modelValue: true,
|
|
38
|
-
},
|
|
39
|
-
});
|
|
40
|
-
|
|
41
|
-
expect(wrapper.html()).toMatchSnapshot();
|
|
42
|
-
});
|
|
43
|
-
|
|
44
|
-
it("should contain 'bimdata-chekbox', 'checked' and 'indeterminate' class when state null", () => {
|
|
45
|
-
const wrapper = shallowMount(BIMDataCheckbox, {
|
|
46
|
-
propsData: {
|
|
47
|
-
modelValue: null,
|
|
48
|
-
},
|
|
49
|
-
});
|
|
50
|
-
|
|
51
|
-
expect(wrapper.html()).toMatchSnapshot();
|
|
52
|
-
});
|
|
53
|
-
|
|
54
|
-
it("should emit change with true if state is false", () => {
|
|
55
|
-
const onClick = jest.fn();
|
|
56
|
-
const wrapper = shallowMount(BIMDataCheckbox, {
|
|
57
|
-
propsData: {
|
|
58
|
-
modelValue: false,
|
|
59
|
-
},
|
|
60
|
-
listeners: {
|
|
61
|
-
"update:modelValue": onClick,
|
|
62
|
-
},
|
|
63
|
-
});
|
|
64
|
-
wrapper.trigger("click");
|
|
65
|
-
expect(onClick).toHaveBeenCalledWith(true);
|
|
66
|
-
});
|
|
67
|
-
|
|
68
|
-
it("should emit change with false if state is true", () => {
|
|
69
|
-
const onClick = jest.fn();
|
|
70
|
-
const wrapper = shallowMount(BIMDataCheckbox, {
|
|
71
|
-
propsData: {
|
|
72
|
-
modelValue: true,
|
|
73
|
-
},
|
|
74
|
-
listeners: {
|
|
75
|
-
"update:modelValue": onClick,
|
|
76
|
-
},
|
|
77
|
-
});
|
|
78
|
-
wrapper.trigger("click");
|
|
79
|
-
expect(onClick).toHaveBeenCalledWith(false);
|
|
80
|
-
});
|
|
81
|
-
|
|
82
|
-
it("should emit change with false if state is null", () => {
|
|
83
|
-
const onClick = jest.fn();
|
|
84
|
-
const wrapper = shallowMount(BIMDataCheckbox, {
|
|
85
|
-
propsData: {
|
|
86
|
-
modelValue: null,
|
|
87
|
-
},
|
|
88
|
-
listeners: {
|
|
89
|
-
"update:modelValue": onClick,
|
|
90
|
-
},
|
|
91
|
-
});
|
|
92
|
-
wrapper.trigger("click");
|
|
93
|
-
expect(onClick).toHaveBeenCalledWith(false);
|
|
94
|
-
});
|
|
95
|
-
});
|
package/src/BIMDataComponents/BIMDataCheckbox/__tests__/__snapshots__/BIMDataCheckbox.test.js.snap
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
-
|
|
3
|
-
exports[`BIMDataCheckbox should contain 'bimdata-checkbox' class when state false 1`] = `
|
|
4
|
-
"<div class=\\"bimdata-checkbox\\" style=\\"margin: 0px;\\"><span class=\\"bimdata-checkbox__mark\\"></span>
|
|
5
|
-
<!---->
|
|
6
|
-
</div>"
|
|
7
|
-
`;
|
|
8
|
-
|
|
9
|
-
exports[`BIMDataCheckbox should contain 'bimdata-chekbox' and 'checked' class when state true 1`] = `
|
|
10
|
-
"<div class=\\"bimdata-checkbox checked\\" style=\\"margin: 0px;\\"><span class=\\"bimdata-checkbox__mark\\"></span>
|
|
11
|
-
<!---->
|
|
12
|
-
</div>"
|
|
13
|
-
`;
|
|
14
|
-
|
|
15
|
-
exports[`BIMDataCheckbox should contain 'bimdata-chekbox', 'checked' and 'indeterminate' class when state null 1`] = `
|
|
16
|
-
"<div class=\\"bimdata-checkbox indeterminate checked\\" style=\\"margin: 0px;\\"><span class=\\"bimdata-checkbox__mark\\"></span>
|
|
17
|
-
<!---->
|
|
18
|
-
</div>"
|
|
19
|
-
`;
|
|
20
|
-
|
|
21
|
-
exports[`BIMDataCheckbox should render component and match snapshot 1`] = `
|
|
22
|
-
"<div class=\\"bimdata-checkbox\\" style=\\"margin: 0px;\\"><span class=\\"bimdata-checkbox__mark\\"></span>
|
|
23
|
-
<!---->
|
|
24
|
-
</div>"
|
|
25
|
-
`;
|
|
26
|
-
|
|
27
|
-
exports[`BIMDataCheckbox should render component with text and match snapshot 1`] = `"<div class=\\"bimdata-checkbox\\" style=\\"margin: 0px;\\"><span class=\\"bimdata-checkbox__mark\\"></span> <span class=\\"bimdata-checkbox__text\\">text checkbox</span></div>"`;
|
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
import { shallowMount } from "@vue/test-utils";
|
|
2
|
-
import BIMDataInput from "../BIMDataInput.vue";
|
|
3
|
-
|
|
4
|
-
describe("BIMDataInput", () => {
|
|
5
|
-
it("should render component and match snapshot", () => {
|
|
6
|
-
const wrapper = shallowMount(BIMDataInput);
|
|
7
|
-
expect(wrapper.html()).toMatchSnapshot();
|
|
8
|
-
});
|
|
9
|
-
|
|
10
|
-
it("should render component with placeholder and match snapshot", () => {
|
|
11
|
-
const wrapper = shallowMount(BIMDataInput, {
|
|
12
|
-
propsData: {
|
|
13
|
-
placeholder: "input placeholder",
|
|
14
|
-
},
|
|
15
|
-
});
|
|
16
|
-
expect(wrapper.html()).toMatchSnapshot();
|
|
17
|
-
});
|
|
18
|
-
|
|
19
|
-
it("should render component with error message and match snapshot", () => {
|
|
20
|
-
const wrapper = shallowMount(BIMDataInput, {
|
|
21
|
-
propsData: {
|
|
22
|
-
error: true,
|
|
23
|
-
errorMessage: "error message",
|
|
24
|
-
},
|
|
25
|
-
});
|
|
26
|
-
expect(wrapper.html()).toMatchSnapshot();
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
it("should render component with success message and match snapshot", () => {
|
|
30
|
-
const wrapper = shallowMount(BIMDataInput, {
|
|
31
|
-
propsData: {
|
|
32
|
-
success: true,
|
|
33
|
-
successMessage: "success message",
|
|
34
|
-
},
|
|
35
|
-
});
|
|
36
|
-
expect(wrapper.html()).toMatchSnapshot();
|
|
37
|
-
});
|
|
38
|
-
|
|
39
|
-
it("should render loading component and match snapshot", () => {
|
|
40
|
-
const wrapper = shallowMount(BIMDataInput, {
|
|
41
|
-
propsData: {
|
|
42
|
-
loading: true,
|
|
43
|
-
},
|
|
44
|
-
});
|
|
45
|
-
expect(wrapper.html()).toMatchSnapshot();
|
|
46
|
-
});
|
|
47
|
-
|
|
48
|
-
it("should render disabled component and match snapshot", () => {
|
|
49
|
-
const wrapper = shallowMount(BIMDataInput, {
|
|
50
|
-
propsData: {
|
|
51
|
-
disabled: true,
|
|
52
|
-
},
|
|
53
|
-
});
|
|
54
|
-
expect(wrapper.html()).toMatchSnapshot();
|
|
55
|
-
});
|
|
56
|
-
|
|
57
|
-
it("should render component with 'not empty' class and match snapshot", () => {
|
|
58
|
-
const wrapper = shallowMount(BIMDataInput, {
|
|
59
|
-
propsData: {
|
|
60
|
-
modelValue: "text message",
|
|
61
|
-
},
|
|
62
|
-
});
|
|
63
|
-
expect(wrapper.classes("not-empty")).toBe(true);
|
|
64
|
-
expect(wrapper.html()).toMatchSnapshot();
|
|
65
|
-
});
|
|
66
|
-
|
|
67
|
-
it("should work with v-model binding", async () => {
|
|
68
|
-
const onInput = jest.fn();
|
|
69
|
-
const wrapper = shallowMount(BIMDataInput, {
|
|
70
|
-
listeners: {
|
|
71
|
-
"update:modelValue": onInput,
|
|
72
|
-
},
|
|
73
|
-
});
|
|
74
|
-
expect(wrapper.find("input").element.value).toBe("");
|
|
75
|
-
|
|
76
|
-
wrapper.find("input").setValue("x");
|
|
77
|
-
expect(onInput).toHaveBeenCalledWith("x");
|
|
78
|
-
|
|
79
|
-
wrapper.setProps({ modelValue: "message" });
|
|
80
|
-
await wrapper.vm.$nextTick();
|
|
81
|
-
expect(wrapper.find("input").element.value).toBe("message");
|
|
82
|
-
});
|
|
83
|
-
|
|
84
|
-
it("should render a button with a slot and match snapshot", () => {
|
|
85
|
-
const wrapper = shallowMount(BIMDataInput, {
|
|
86
|
-
slots: {
|
|
87
|
-
inputIcon: "test icon slot",
|
|
88
|
-
},
|
|
89
|
-
});
|
|
90
|
-
expect(wrapper.html()).toMatchSnapshot();
|
|
91
|
-
});
|
|
92
|
-
});
|
package/src/BIMDataComponents/BIMDataInput/__tests__/__snapshots__/BIMDataInput.test.js.snap
DELETED
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
-
|
|
3
|
-
exports[`BIMDataInput should render a button with a slot and match snapshot 1`] = `
|
|
4
|
-
"<div class=\\"bimdata-input\\" style=\\"margin: 12px 0px;\\"><input id=\\"bimdata-input-8\\" autocomplete=\\"off\\">
|
|
5
|
-
<div class=\\"bimdata-input__icon\\">test icon slot</div> <label for=\\"bimdata-input-8\\"></label> <span class=\\"bar\\"></span>
|
|
6
|
-
<!---->
|
|
7
|
-
<!---->
|
|
8
|
-
</div>"
|
|
9
|
-
`;
|
|
10
|
-
|
|
11
|
-
exports[`BIMDataInput should render component and match snapshot 1`] = `
|
|
12
|
-
"<div class=\\"bimdata-input\\" style=\\"margin: 12px 0px;\\"><input id=\\"bimdata-input-0\\" autocomplete=\\"off\\">
|
|
13
|
-
<div class=\\"bimdata-input__icon\\"></div> <label for=\\"bimdata-input-0\\"></label> <span class=\\"bar\\"></span>
|
|
14
|
-
<!---->
|
|
15
|
-
<!---->
|
|
16
|
-
</div>"
|
|
17
|
-
`;
|
|
18
|
-
|
|
19
|
-
exports[`BIMDataInput should render component with 'not empty' class and match snapshot 1`] = `
|
|
20
|
-
"<div class=\\"bimdata-input not-empty\\" style=\\"margin: 12px 0px;\\"><input id=\\"bimdata-input-6\\" autocomplete=\\"off\\">
|
|
21
|
-
<div class=\\"bimdata-input__icon\\"></div> <label for=\\"bimdata-input-6\\"></label> <span class=\\"bar\\"></span>
|
|
22
|
-
<!---->
|
|
23
|
-
<!---->
|
|
24
|
-
</div>"
|
|
25
|
-
`;
|
|
26
|
-
|
|
27
|
-
exports[`BIMDataInput should render component with error message and match snapshot 1`] = `
|
|
28
|
-
"<div class=\\"bimdata-input error\\" style=\\"margin: 12px 0px;\\"><input id=\\"bimdata-input-2\\" autocomplete=\\"off\\">
|
|
29
|
-
<div class=\\"bimdata-input__icon\\"></div> <label for=\\"bimdata-input-2\\"></label> <span class=\\"bar\\"></span> <span class=\\"error\\">error message</span>
|
|
30
|
-
<!---->
|
|
31
|
-
</div>"
|
|
32
|
-
`;
|
|
33
|
-
|
|
34
|
-
exports[`BIMDataInput should render component with placeholder and match snapshot 1`] = `
|
|
35
|
-
"<div class=\\"bimdata-input\\" style=\\"margin: 12px 0px;\\"><input id=\\"bimdata-input-1\\" autocomplete=\\"off\\">
|
|
36
|
-
<div class=\\"bimdata-input__icon\\"></div> <label for=\\"bimdata-input-1\\">input placeholder</label> <span class=\\"bar\\"></span>
|
|
37
|
-
<!---->
|
|
38
|
-
<!---->
|
|
39
|
-
</div>"
|
|
40
|
-
`;
|
|
41
|
-
|
|
42
|
-
exports[`BIMDataInput should render component with success message and match snapshot 1`] = `
|
|
43
|
-
"<div class=\\"bimdata-input success\\" style=\\"margin: 12px 0px;\\"><input id=\\"bimdata-input-3\\" autocomplete=\\"off\\">
|
|
44
|
-
<div class=\\"bimdata-input__icon\\"></div> <label for=\\"bimdata-input-3\\"></label> <span class=\\"bar\\"></span>
|
|
45
|
-
<!----> <span class=\\"success\\">success message</span>
|
|
46
|
-
</div>"
|
|
47
|
-
`;
|
|
48
|
-
|
|
49
|
-
exports[`BIMDataInput should render disabled component and match snapshot 1`] = `
|
|
50
|
-
"<div class=\\"bimdata-input disabled\\" style=\\"margin: 12px 0px;\\"><input id=\\"bimdata-input-5\\" disabled=\\"disabled\\" autocomplete=\\"off\\">
|
|
51
|
-
<div class=\\"bimdata-input__icon\\"></div> <label for=\\"bimdata-input-5\\"></label> <span class=\\"bar\\"></span>
|
|
52
|
-
<!---->
|
|
53
|
-
<!---->
|
|
54
|
-
</div>"
|
|
55
|
-
`;
|
|
56
|
-
|
|
57
|
-
exports[`BIMDataInput should render loading component and match snapshot 1`] = `
|
|
58
|
-
"<div class=\\"bimdata-input loading\\" style=\\"margin: 12px 0px;\\"><input id=\\"bimdata-input-4\\" autocomplete=\\"off\\">
|
|
59
|
-
<div class=\\"bimdata-input__icon\\"></div> <label for=\\"bimdata-input-4\\"></label> <span class=\\"bar\\"></span>
|
|
60
|
-
<!---->
|
|
61
|
-
<!---->
|
|
62
|
-
</div>"
|
|
63
|
-
`;
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
import { shallowMount } from "@vue/test-utils";
|
|
2
|
-
import BIMDataNavigation from "../BIMDataNavigation.vue";
|
|
3
|
-
import BIMDataButton from "../../BIMDataButton/BIMDataButton.vue";
|
|
4
|
-
|
|
5
|
-
describe("BIMDataNavigation", () => {
|
|
6
|
-
it("should render component and match snapshot", () => {
|
|
7
|
-
const wrapper = shallowMount(BIMDataNavigation);
|
|
8
|
-
expect(wrapper.html()).toMatchSnapshot();
|
|
9
|
-
});
|
|
10
|
-
|
|
11
|
-
it("should render a navigation with a left slot and match snapshot", () => {
|
|
12
|
-
const wrapper = shallowMount(BIMDataNavigation, {
|
|
13
|
-
slots: {
|
|
14
|
-
left: "<span>left slot</span>",
|
|
15
|
-
},
|
|
16
|
-
});
|
|
17
|
-
expect(wrapper.html()).toMatchSnapshot();
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
it("should render a navigation with a right slot and match snapshot", () => {
|
|
21
|
-
const wrapper = shallowMount(BIMDataNavigation, {
|
|
22
|
-
slots: {
|
|
23
|
-
right: "<span>right slot</span>",
|
|
24
|
-
},
|
|
25
|
-
});
|
|
26
|
-
expect(wrapper.html()).toMatchSnapshot();
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
it("should render li tag", () => {
|
|
30
|
-
const wrapper = shallowMount(BIMDataNavigation);
|
|
31
|
-
expect(wrapper.find(".bimdata-navigation__item").element).toBeTruthy();
|
|
32
|
-
});
|
|
33
|
-
|
|
34
|
-
it("should not render BIMDataButton", () => {
|
|
35
|
-
const wrapper = shallowMount(BIMDataNavigation, {
|
|
36
|
-
propsData: {
|
|
37
|
-
first: false,
|
|
38
|
-
last: false,
|
|
39
|
-
previous: false,
|
|
40
|
-
next: false,
|
|
41
|
-
},
|
|
42
|
-
});
|
|
43
|
-
expect(wrapper.findComponent(BIMDataButton).exists()).toBe(false);
|
|
44
|
-
});
|
|
45
|
-
|
|
46
|
-
it("should render BIMDataButton disabled", () => {
|
|
47
|
-
const wrapper = shallowMount(BIMDataNavigation, {
|
|
48
|
-
propsData: {
|
|
49
|
-
firstDisabled: true,
|
|
50
|
-
previousDisabled: true,
|
|
51
|
-
nextDisabled: true,
|
|
52
|
-
lastDisabled: true,
|
|
53
|
-
},
|
|
54
|
-
});
|
|
55
|
-
expect(wrapper.findComponent(BIMDataButton).classes("disabled")).toBe(true);
|
|
56
|
-
expect(wrapper.html()).toMatchSnapshot();
|
|
57
|
-
});
|
|
58
|
-
|
|
59
|
-
it("should emit first event", async () => {
|
|
60
|
-
const wrapper = shallowMount(BIMDataNavigation);
|
|
61
|
-
wrapper.vm.$emit("first");
|
|
62
|
-
await wrapper.vm.$nextTick();
|
|
63
|
-
expect(wrapper.emitted("first")).toBeTruthy();
|
|
64
|
-
});
|
|
65
|
-
|
|
66
|
-
it("should emit previous event", async () => {
|
|
67
|
-
const wrapper = shallowMount(BIMDataNavigation);
|
|
68
|
-
wrapper.vm.$emit("previous");
|
|
69
|
-
await wrapper.vm.$nextTick();
|
|
70
|
-
expect(wrapper.emitted("previous")).toBeTruthy();
|
|
71
|
-
});
|
|
72
|
-
|
|
73
|
-
it("should emit next event", async () => {
|
|
74
|
-
const wrapper = shallowMount(BIMDataNavigation);
|
|
75
|
-
wrapper.vm.$emit("next");
|
|
76
|
-
await wrapper.vm.$nextTick();
|
|
77
|
-
expect(wrapper.emitted("next")).toBeTruthy();
|
|
78
|
-
});
|
|
79
|
-
|
|
80
|
-
it("should emit last event", async () => {
|
|
81
|
-
const wrapper = shallowMount(BIMDataNavigation);
|
|
82
|
-
wrapper.vm.$emit("last");
|
|
83
|
-
await wrapper.vm.$nextTick();
|
|
84
|
-
expect(wrapper.emitted("last")).toBeTruthy();
|
|
85
|
-
});
|
|
86
|
-
});
|