@zeedhi/teknisa-components-common 1.108.0 → 1.109.1
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/LICENSE +21 -21
- package/README.md +7 -7
- package/coverage/clover.xml +49 -49
- package/coverage/coverage-final.json +47 -47
- package/coverage/lcov-report/index.html +1 -1
- package/coverage/lcov-report/tests/__helpers__/component-event-helper.ts.html +1 -1
- package/coverage/lcov-report/tests/__helpers__/flush-promises-helper.ts.html +1 -1
- package/coverage/lcov-report/tests/__helpers__/get-child-helper.ts.html +1 -1
- package/coverage/lcov-report/tests/__helpers__/index.html +1 -1
- package/coverage/lcov-report/tests/__helpers__/index.ts.html +1 -1
- package/coverage/lcov-report/tests/__helpers__/mock-created-helper.ts.html +1 -1
- package/coverage/lcov.info +47 -47
- package/jest.config.js +1 -1
- package/package.json +2 -2
- package/tests/__helpers__/component-event-helper.ts +5 -5
- package/tests/__helpers__/flush-promises-helper.ts +3 -3
- package/tests/__helpers__/get-child-helper.ts +27 -27
- package/tests/__helpers__/index.ts +3 -3
- package/tests/__helpers__/mock-created-helper.ts +12 -12
- package/tests/__mocks__/@zeedhi/core/i18n.js +74 -74
- package/tests/__mocks__/@zeedhi/core.js +4 -4
- package/tests/unit/components/crud/crud-add-button.spec.ts +56 -56
- package/tests/unit/components/crud/crud-button.spec.ts +94 -94
- package/tests/unit/components/crud/crud-cancel-button.spec.ts +91 -91
- package/tests/unit/components/crud/crud-delete-button.spec.ts +122 -122
- package/tests/unit/components/crud/crud-form.spec.ts +165 -165
- package/tests/unit/components/crud/crud-save-button.spec.ts +118 -118
- package/tests/unit/components/tek-breadcrumb-header/tek-breadcrumb-header.spec.ts +42 -42
- package/tests/unit/components/tek-card-title/CardTitle.spec.ts +34 -34
- package/tests/unit/components/tek-datasource/memory-datasource.spec.ts +470 -470
- package/tests/unit/components/tek-datasource/rest-datasource.spec.ts +364 -364
- package/tests/unit/components/tek-drag-grid/tek-drag-grid.spec.ts +112 -112
- package/tests/unit/components/tek-grid/filter-helper.spec.ts +148 -148
- package/tests/unit/components/tek-grid/grid-column.spec.ts +270 -270
- package/tests/unit/components/tek-grid/grid-columns-button.spec.ts +195 -195
- package/tests/unit/components/tek-grid/grid-filter-button.spec.ts +967 -967
- package/tests/unit/components/tek-grid/grid.spec.ts +3340 -3340
- package/tests/unit/components/tek-grid/layout_options.spec.ts +980 -980
- package/tests/unit/components/tek-image/Image.spec.ts +67 -67
- package/tests/unit/components/tek-iterable-carousel/iterable-carousel.spec.ts +37 -37
- package/tests/unit/components/tek-iterable-component-render/iterable-component-render.spec.ts +200 -200
- package/tests/unit/components/tek-loading/Loading.spec.ts +30 -30
- package/tests/unit/components/tek-notifications/notifications.spec.ts +201 -201
- package/tests/unit/components/tek-product-card/product-card.spec.ts +61 -61
- package/tests/unit/components/tek-user-info/TekUserInfoContoller.spec.ts +220 -220
- package/tests/unit/components/tek-user-info/tek-user-info-list.spec.ts +86 -86
- package/tests/unit/components/tek-user-info/tek-user-info.spec.ts +430 -430
- package/tests/unit/components/tree-grid/tree-grid.spec.ts +776 -776
- package/tests/unit/utils/grid-base/delete-rows-error.spec.ts +24 -24
- package/tests/unit/utils/grid-base/export-options/button-option.spec.ts +44 -44
- package/tests/unit/utils/grid-base/export-options/multi-option.spec.ts +135 -135
- package/tests/unit/utils/grid-base/grid-controller.spec.ts +267 -267
- package/tests/unit/utils/report-filter/report-filter.spec.ts +66 -66
- package/tsconfig.eslint.json +8 -8
- package/types/components/tek-ag-grid/default-icons.d.ts +53 -0
- package/types/components/tek-ag-grid/interfaces.d.ts +9 -0
- package/types/components/tek-ag-grid/tek-ag-grid.d.ts +35 -0
- package/types/components/tek-datasource/datasource.d.ts +94 -0
- package/types/components/tek-datasource/memory-datasource.d.ts +4 -2
- package/types/components/tek-datasource/rest-datasource.d.ts +4 -6
- package/types/components/tek-grid/default-icons.d.ts +53 -0
- package/types/components/tek-grid/filter-dynamic-values.d.ts +9 -0
- package/types/components/tek-grid/grid-controller.d.ts +19 -0
- package/types/components/tek-grid/grid_column.d.ts +14 -0
- package/types/components/tek-grid/grid_controller.d.ts +15 -0
- package/types/components/tek-grid/tek-grid.d.ts +35 -0
- package/types/components/tek-login/interfaces.d.ts +3 -0
- package/types/components/tek-login/login-children.d.ts +3 -0
- package/types/components/tek-login/login.d.ts +58 -0
- package/types/components/tek-login/login_children.d.ts +3 -0
|
@@ -1,118 +1,118 @@
|
|
|
1
|
-
import { GridEditable } from '@zeedhi/common';
|
|
2
|
-
import { CrudForm, CrudSaveButton } from '../../../../src';
|
|
3
|
-
|
|
4
|
-
describe('CrudSaveButton', () => {
|
|
5
|
-
describe('constructor()', () => {
|
|
6
|
-
it('should create new CrudSaveButton with default values', () => {
|
|
7
|
-
const instance = new CrudSaveButton({
|
|
8
|
-
name: 'button',
|
|
9
|
-
component: 'TekCrudSaveButton',
|
|
10
|
-
clickShortcutKey: 'ctrl+enter',
|
|
11
|
-
});
|
|
12
|
-
|
|
13
|
-
expect(instance.clickShortcutKey).toBe('ctrl+enter');
|
|
14
|
-
expect(instance.label).toBe('SAVE');
|
|
15
|
-
});
|
|
16
|
-
|
|
17
|
-
it('should create new CrudSaveButton replace default values', () => {
|
|
18
|
-
const instance = new CrudSaveButton({
|
|
19
|
-
name: 'button',
|
|
20
|
-
component: 'TekCrudSaveButton',
|
|
21
|
-
clickShortcutKey: '',
|
|
22
|
-
label: 'Salvar',
|
|
23
|
-
});
|
|
24
|
-
|
|
25
|
-
expect(instance.clickShortcutKey).toBe('ctrl+enter');
|
|
26
|
-
expect(instance.label).toBe('Salvar');
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
it('CrudSaveButton click()', () => {
|
|
30
|
-
const method = jest.fn();
|
|
31
|
-
const instance = new CrudSaveButton({
|
|
32
|
-
name: 'button',
|
|
33
|
-
component: 'TekCrudSaveButton',
|
|
34
|
-
events: { click: method },
|
|
35
|
-
});
|
|
36
|
-
|
|
37
|
-
instance.click({} as Event, {} as HTMLElement);
|
|
38
|
-
expect(method).not.toHaveBeenCalled();
|
|
39
|
-
const crudForm = new CrudForm({ name: 'form', component: 'CrudForm' });
|
|
40
|
-
instance.parent = crudForm;
|
|
41
|
-
|
|
42
|
-
instance.click({} as Event, {} as HTMLElement);
|
|
43
|
-
expect(method).toHaveBeenCalled();
|
|
44
|
-
});
|
|
45
|
-
|
|
46
|
-
it('click() CrudForm with defaultPrevent false', () => {
|
|
47
|
-
const instance = new CrudSaveButton({
|
|
48
|
-
name: 'cancelButton',
|
|
49
|
-
component: 'TekCrudCancelButton',
|
|
50
|
-
});
|
|
51
|
-
|
|
52
|
-
instance.click({ defaultPrevented: false } as Event, {} as HTMLElement);
|
|
53
|
-
const crudForm = new CrudForm({ name: 'form', component: 'CrudForm' });
|
|
54
|
-
instance.parent = crudForm;
|
|
55
|
-
instance.click({ defaultPrevented: true } as Event, {} as HTMLElement);
|
|
56
|
-
expect(instance.parent).toBeInstanceOf(CrudForm);
|
|
57
|
-
});
|
|
58
|
-
|
|
59
|
-
it('CrudSaveButton click() no validate', () => {
|
|
60
|
-
const method = jest.fn();
|
|
61
|
-
const instance = new CrudSaveButton({
|
|
62
|
-
name: 'button',
|
|
63
|
-
component: 'TekCrudSaveButton',
|
|
64
|
-
events: { click: method },
|
|
65
|
-
});
|
|
66
|
-
|
|
67
|
-
const crudForm = new CrudForm({ name: 'form', component: 'CrudForm' });
|
|
68
|
-
crudForm.validate = () => false;
|
|
69
|
-
instance.parent = crudForm;
|
|
70
|
-
instance.click({} as Event, {} as HTMLElement);
|
|
71
|
-
expect(method).not.toHaveBeenCalled();
|
|
72
|
-
});
|
|
73
|
-
|
|
74
|
-
it('CrudSaveButton click() when event is not prevented', () => {
|
|
75
|
-
const instance = new CrudSaveButton({
|
|
76
|
-
name: 'button',
|
|
77
|
-
component: 'TekCrudSaveButton',
|
|
78
|
-
});
|
|
79
|
-
|
|
80
|
-
const crudForm = new CrudForm({ name: 'form', component: 'CrudForm' });
|
|
81
|
-
instance.parent = crudForm;
|
|
82
|
-
instance.click({ defaultPrevented: false } as Event, {} as HTMLElement);
|
|
83
|
-
expect(crudForm.saveEdit).toBeTruthy();
|
|
84
|
-
instance.click({ defaultPrevented: false } as Event, {} as HTMLElement);
|
|
85
|
-
expect(crudForm.editing).toBeFalsy();
|
|
86
|
-
instance.click({ defaultPrevented: false } as Event, {} as HTMLElement);
|
|
87
|
-
expect(crudForm.editing).toBeFalsy();
|
|
88
|
-
});
|
|
89
|
-
|
|
90
|
-
it('click() GridEditable', () => {
|
|
91
|
-
const method = jest.fn();
|
|
92
|
-
const instance = new CrudSaveButton({
|
|
93
|
-
name: 'button',
|
|
94
|
-
component: 'TekCrudSaveButton',
|
|
95
|
-
events: { click: method },
|
|
96
|
-
});
|
|
97
|
-
const gridEditable = new GridEditable({ name: 'form', component: 'GridEditable' });
|
|
98
|
-
instance.click({} as Event, {} as HTMLElement);
|
|
99
|
-
expect(method).not.toHaveBeenCalled();
|
|
100
|
-
instance.parent = gridEditable;
|
|
101
|
-
instance.click({} as Event, {} as HTMLElement);
|
|
102
|
-
expect(method).toHaveBeenCalled();
|
|
103
|
-
});
|
|
104
|
-
|
|
105
|
-
it('click() GridEditable with defaultPrevent false', () => {
|
|
106
|
-
const instance = new CrudSaveButton({
|
|
107
|
-
name: 'cancelButton',
|
|
108
|
-
component: 'TekCrudCancelButton',
|
|
109
|
-
});
|
|
110
|
-
|
|
111
|
-
instance.click({ defaultPrevented: false } as Event, {} as HTMLElement);
|
|
112
|
-
const grid = new GridEditable({ name: 'form', component: 'GridEditable' });
|
|
113
|
-
instance.parent = grid;
|
|
114
|
-
instance.click({ defaultPrevented: true } as Event, {} as HTMLElement);
|
|
115
|
-
expect(instance.parent).toBeInstanceOf(GridEditable);
|
|
116
|
-
});
|
|
117
|
-
});
|
|
118
|
-
});
|
|
1
|
+
import { GridEditable } from '@zeedhi/common';
|
|
2
|
+
import { CrudForm, CrudSaveButton } from '../../../../src';
|
|
3
|
+
|
|
4
|
+
describe('CrudSaveButton', () => {
|
|
5
|
+
describe('constructor()', () => {
|
|
6
|
+
it('should create new CrudSaveButton with default values', () => {
|
|
7
|
+
const instance = new CrudSaveButton({
|
|
8
|
+
name: 'button',
|
|
9
|
+
component: 'TekCrudSaveButton',
|
|
10
|
+
clickShortcutKey: 'ctrl+enter',
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
expect(instance.clickShortcutKey).toBe('ctrl+enter');
|
|
14
|
+
expect(instance.label).toBe('SAVE');
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
it('should create new CrudSaveButton replace default values', () => {
|
|
18
|
+
const instance = new CrudSaveButton({
|
|
19
|
+
name: 'button',
|
|
20
|
+
component: 'TekCrudSaveButton',
|
|
21
|
+
clickShortcutKey: '',
|
|
22
|
+
label: 'Salvar',
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
expect(instance.clickShortcutKey).toBe('ctrl+enter');
|
|
26
|
+
expect(instance.label).toBe('Salvar');
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
it('CrudSaveButton click()', () => {
|
|
30
|
+
const method = jest.fn();
|
|
31
|
+
const instance = new CrudSaveButton({
|
|
32
|
+
name: 'button',
|
|
33
|
+
component: 'TekCrudSaveButton',
|
|
34
|
+
events: { click: method },
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
instance.click({} as Event, {} as HTMLElement);
|
|
38
|
+
expect(method).not.toHaveBeenCalled();
|
|
39
|
+
const crudForm = new CrudForm({ name: 'form', component: 'CrudForm' });
|
|
40
|
+
instance.parent = crudForm;
|
|
41
|
+
|
|
42
|
+
instance.click({} as Event, {} as HTMLElement);
|
|
43
|
+
expect(method).toHaveBeenCalled();
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
it('click() CrudForm with defaultPrevent false', () => {
|
|
47
|
+
const instance = new CrudSaveButton({
|
|
48
|
+
name: 'cancelButton',
|
|
49
|
+
component: 'TekCrudCancelButton',
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
instance.click({ defaultPrevented: false } as Event, {} as HTMLElement);
|
|
53
|
+
const crudForm = new CrudForm({ name: 'form', component: 'CrudForm' });
|
|
54
|
+
instance.parent = crudForm;
|
|
55
|
+
instance.click({ defaultPrevented: true } as Event, {} as HTMLElement);
|
|
56
|
+
expect(instance.parent).toBeInstanceOf(CrudForm);
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
it('CrudSaveButton click() no validate', () => {
|
|
60
|
+
const method = jest.fn();
|
|
61
|
+
const instance = new CrudSaveButton({
|
|
62
|
+
name: 'button',
|
|
63
|
+
component: 'TekCrudSaveButton',
|
|
64
|
+
events: { click: method },
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
const crudForm = new CrudForm({ name: 'form', component: 'CrudForm' });
|
|
68
|
+
crudForm.validate = () => false;
|
|
69
|
+
instance.parent = crudForm;
|
|
70
|
+
instance.click({} as Event, {} as HTMLElement);
|
|
71
|
+
expect(method).not.toHaveBeenCalled();
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
it('CrudSaveButton click() when event is not prevented', () => {
|
|
75
|
+
const instance = new CrudSaveButton({
|
|
76
|
+
name: 'button',
|
|
77
|
+
component: 'TekCrudSaveButton',
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
const crudForm = new CrudForm({ name: 'form', component: 'CrudForm' });
|
|
81
|
+
instance.parent = crudForm;
|
|
82
|
+
instance.click({ defaultPrevented: false } as Event, {} as HTMLElement);
|
|
83
|
+
expect(crudForm.saveEdit).toBeTruthy();
|
|
84
|
+
instance.click({ defaultPrevented: false } as Event, {} as HTMLElement);
|
|
85
|
+
expect(crudForm.editing).toBeFalsy();
|
|
86
|
+
instance.click({ defaultPrevented: false } as Event, {} as HTMLElement);
|
|
87
|
+
expect(crudForm.editing).toBeFalsy();
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
it('click() GridEditable', () => {
|
|
91
|
+
const method = jest.fn();
|
|
92
|
+
const instance = new CrudSaveButton({
|
|
93
|
+
name: 'button',
|
|
94
|
+
component: 'TekCrudSaveButton',
|
|
95
|
+
events: { click: method },
|
|
96
|
+
});
|
|
97
|
+
const gridEditable = new GridEditable({ name: 'form', component: 'GridEditable' });
|
|
98
|
+
instance.click({} as Event, {} as HTMLElement);
|
|
99
|
+
expect(method).not.toHaveBeenCalled();
|
|
100
|
+
instance.parent = gridEditable;
|
|
101
|
+
instance.click({} as Event, {} as HTMLElement);
|
|
102
|
+
expect(method).toHaveBeenCalled();
|
|
103
|
+
});
|
|
104
|
+
|
|
105
|
+
it('click() GridEditable with defaultPrevent false', () => {
|
|
106
|
+
const instance = new CrudSaveButton({
|
|
107
|
+
name: 'cancelButton',
|
|
108
|
+
component: 'TekCrudCancelButton',
|
|
109
|
+
});
|
|
110
|
+
|
|
111
|
+
instance.click({ defaultPrevented: false } as Event, {} as HTMLElement);
|
|
112
|
+
const grid = new GridEditable({ name: 'form', component: 'GridEditable' });
|
|
113
|
+
instance.parent = grid;
|
|
114
|
+
instance.click({ defaultPrevented: true } as Event, {} as HTMLElement);
|
|
115
|
+
expect(instance.parent).toBeInstanceOf(GridEditable);
|
|
116
|
+
});
|
|
117
|
+
});
|
|
118
|
+
});
|
|
@@ -1,42 +1,42 @@
|
|
|
1
|
-
import { BreadcrumbHeader, Image } from '../../../../src';
|
|
2
|
-
|
|
3
|
-
describe('BreadcrumbHeader', () => {
|
|
4
|
-
describe('constructor()', () => {
|
|
5
|
-
it('should create new BreadcrumbHeader with default values', () => {
|
|
6
|
-
const instance = new BreadcrumbHeader({
|
|
7
|
-
name: 'BreadcrumbHeader',
|
|
8
|
-
component: 'TekBreadcrumbHeader',
|
|
9
|
-
title: '',
|
|
10
|
-
breadcrumb: {
|
|
11
|
-
name: 'breadcrumb',
|
|
12
|
-
component: 'ZdBreadcrumb',
|
|
13
|
-
divider: '>',
|
|
14
|
-
},
|
|
15
|
-
});
|
|
16
|
-
expect(instance.title).toBe('');
|
|
17
|
-
expect(instance.rightSlot).toStrictEqual([]);
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
it('should create new BreadcrumbHeader with rightSlot values', () => {
|
|
21
|
-
const image = new Image({
|
|
22
|
-
name: 'image',
|
|
23
|
-
component: 'tekImage',
|
|
24
|
-
src: '/img/zeedhi.svg',
|
|
25
|
-
to: 'google.com.br',
|
|
26
|
-
});
|
|
27
|
-
const instance = new BreadcrumbHeader({
|
|
28
|
-
name: 'BreadcrumbHeader',
|
|
29
|
-
component: 'TekBreadcrumbHeader',
|
|
30
|
-
title: '',
|
|
31
|
-
breadcrumb: {
|
|
32
|
-
name: 'breadcrumb',
|
|
33
|
-
component: 'ZdBreadcrumb',
|
|
34
|
-
divider: '>',
|
|
35
|
-
},
|
|
36
|
-
rightSlot: [image],
|
|
37
|
-
});
|
|
38
|
-
expect(instance.title).toBe('');
|
|
39
|
-
expect(instance.rightSlot).toEqual([image]);
|
|
40
|
-
});
|
|
41
|
-
});
|
|
42
|
-
});
|
|
1
|
+
import { BreadcrumbHeader, Image } from '../../../../src';
|
|
2
|
+
|
|
3
|
+
describe('BreadcrumbHeader', () => {
|
|
4
|
+
describe('constructor()', () => {
|
|
5
|
+
it('should create new BreadcrumbHeader with default values', () => {
|
|
6
|
+
const instance = new BreadcrumbHeader({
|
|
7
|
+
name: 'BreadcrumbHeader',
|
|
8
|
+
component: 'TekBreadcrumbHeader',
|
|
9
|
+
title: '',
|
|
10
|
+
breadcrumb: {
|
|
11
|
+
name: 'breadcrumb',
|
|
12
|
+
component: 'ZdBreadcrumb',
|
|
13
|
+
divider: '>',
|
|
14
|
+
},
|
|
15
|
+
});
|
|
16
|
+
expect(instance.title).toBe('');
|
|
17
|
+
expect(instance.rightSlot).toStrictEqual([]);
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
it('should create new BreadcrumbHeader with rightSlot values', () => {
|
|
21
|
+
const image = new Image({
|
|
22
|
+
name: 'image',
|
|
23
|
+
component: 'tekImage',
|
|
24
|
+
src: '/img/zeedhi.svg',
|
|
25
|
+
to: 'google.com.br',
|
|
26
|
+
});
|
|
27
|
+
const instance = new BreadcrumbHeader({
|
|
28
|
+
name: 'BreadcrumbHeader',
|
|
29
|
+
component: 'TekBreadcrumbHeader',
|
|
30
|
+
title: '',
|
|
31
|
+
breadcrumb: {
|
|
32
|
+
name: 'breadcrumb',
|
|
33
|
+
component: 'ZdBreadcrumb',
|
|
34
|
+
divider: '>',
|
|
35
|
+
},
|
|
36
|
+
rightSlot: [image],
|
|
37
|
+
});
|
|
38
|
+
expect(instance.title).toBe('');
|
|
39
|
+
expect(instance.rightSlot).toEqual([image]);
|
|
40
|
+
});
|
|
41
|
+
});
|
|
42
|
+
});
|
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
import { CardTitle } from '../../../../src';
|
|
2
|
-
|
|
3
|
-
describe('CardTitle', () => {
|
|
4
|
-
describe('constructor()', () => {
|
|
5
|
-
it('should create new TekCardTitle with default values', () => {
|
|
6
|
-
const instance = new CardTitle({
|
|
7
|
-
name: 'cardTitle',
|
|
8
|
-
component: 'TekCardTitle',
|
|
9
|
-
subtitle: '',
|
|
10
|
-
title: '',
|
|
11
|
-
iconName: '',
|
|
12
|
-
});
|
|
13
|
-
expect(instance.subtitle).toBe('');
|
|
14
|
-
expect(instance.title).toBe('');
|
|
15
|
-
expect(instance.to).toBe('');
|
|
16
|
-
expect(instance.showDivider).toBeTruthy();
|
|
17
|
-
});
|
|
18
|
-
|
|
19
|
-
it('should create new TekCardTitle replacing default values', () => {
|
|
20
|
-
const instance = new CardTitle({
|
|
21
|
-
name: 'cardTitle',
|
|
22
|
-
component: 'TekCardTitle',
|
|
23
|
-
subtitle: 'subtitle',
|
|
24
|
-
title: 'Title',
|
|
25
|
-
iconName: 'info',
|
|
26
|
-
showDivider: false,
|
|
27
|
-
});
|
|
28
|
-
expect(instance.subtitle).toBe('subtitle');
|
|
29
|
-
expect(instance.title).toBe('Title');
|
|
30
|
-
expect(instance.iconName).toBe('info');
|
|
31
|
-
expect(instance.showDivider).toBeFalsy();
|
|
32
|
-
});
|
|
33
|
-
});
|
|
34
|
-
});
|
|
1
|
+
import { CardTitle } from '../../../../src';
|
|
2
|
+
|
|
3
|
+
describe('CardTitle', () => {
|
|
4
|
+
describe('constructor()', () => {
|
|
5
|
+
it('should create new TekCardTitle with default values', () => {
|
|
6
|
+
const instance = new CardTitle({
|
|
7
|
+
name: 'cardTitle',
|
|
8
|
+
component: 'TekCardTitle',
|
|
9
|
+
subtitle: '',
|
|
10
|
+
title: '',
|
|
11
|
+
iconName: '',
|
|
12
|
+
});
|
|
13
|
+
expect(instance.subtitle).toBe('');
|
|
14
|
+
expect(instance.title).toBe('');
|
|
15
|
+
expect(instance.to).toBe('');
|
|
16
|
+
expect(instance.showDivider).toBeTruthy();
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
it('should create new TekCardTitle replacing default values', () => {
|
|
20
|
+
const instance = new CardTitle({
|
|
21
|
+
name: 'cardTitle',
|
|
22
|
+
component: 'TekCardTitle',
|
|
23
|
+
subtitle: 'subtitle',
|
|
24
|
+
title: 'Title',
|
|
25
|
+
iconName: 'info',
|
|
26
|
+
showDivider: false,
|
|
27
|
+
});
|
|
28
|
+
expect(instance.subtitle).toBe('subtitle');
|
|
29
|
+
expect(instance.title).toBe('Title');
|
|
30
|
+
expect(instance.iconName).toBe('info');
|
|
31
|
+
expect(instance.showDivider).toBeFalsy();
|
|
32
|
+
});
|
|
33
|
+
});
|
|
34
|
+
});
|