@colijnit/sharedcomponents 1.0.2 → 1.0.5
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/README.md +8 -11
- package/bundles/colijnit-sharedcomponents.umd.js +1901 -0
- package/bundles/colijnit-sharedcomponents.umd.js.map +1 -0
- package/colijnit-sharedcomponents-1.0.5.tgz +0 -0
- package/colijnit-sharedcomponents.d.ts +12 -0
- package/colijnit-sharedcomponents.metadata.json +1 -0
- package/esm2015/colijnit-sharedcomponents.js +13 -0
- package/esm2015/lib/components/docsign/component/signature/signature.component.js +75 -0
- package/esm2015/lib/components/docsign/component/signatures/signatures.component.js +44 -0
- package/esm2015/lib/components/docsign/docsign.component.js +225 -0
- package/esm2015/lib/components/docsign/docsign.module.js +23 -0
- package/esm2015/lib/components/stock/stock-information/stock-information.component.js +60 -0
- package/esm2015/lib/components/stock/stock-information-grid/stock-information-grid.component.js +255 -0
- package/esm2015/lib/components/stock/stock-location/stock-location.component.js +62 -0
- package/esm2015/lib/components/stock/stock-transfer/co-drop-down-list-fields.interface.js +2 -0
- package/esm2015/lib/components/stock/stock-transfer/stock-transfer.component.js +98 -0
- package/esm2015/lib/components/stock/stock.component.js +74 -0
- package/esm2015/lib/components/stock/stock.module.js +42 -0
- package/esm2015/lib/factory/business-object-factory.js +120 -0
- package/esm2015/lib/factory/decorators/boolean.decorator.js +102 -0
- package/esm2015/lib/factory/decorators/complex-array.decorator.js +55 -0
- package/esm2015/lib/factory/decorators/complex-field.decorator.js +57 -0
- package/esm2015/lib/factory/decorators/date-field.decorator.js +36 -0
- package/esm2015/lib/factory/decorators/string-number.decorator.js +43 -0
- package/esm2015/lib/model/business-object.js +81 -0
- package/esm2015/lib/service/ione-connector-adapter.service.js +98 -0
- package/esm2015/lib/service/stock.service.js +28 -0
- package/esm2015/lib/utils/array-utils.js +183 -0
- package/esm2015/lib/utils/is-nill.function.js +5 -0
- package/esm2015/public-api.js +8 -0
- package/fesm2015/colijnit-sharedcomponents.js +1731 -0
- package/fesm2015/colijnit-sharedcomponents.js.map +1 -0
- package/lib/components/docsign/component/signature/signature.component.d.ts +16 -0
- package/{projects/sharedcomponents/src/lib → lib}/components/docsign/component/signature/style/_layout.scss +0 -0
- package/{projects/sharedcomponents/src/lib → lib}/components/docsign/component/signature/style/_material-definition.scss +0 -0
- package/{projects/sharedcomponents/src/lib → lib}/components/docsign/component/signature/style/_theme.scss +0 -0
- package/{projects/sharedcomponents/src/lib → lib}/components/docsign/component/signature/style/material.scss +0 -0
- package/lib/components/docsign/component/signatures/signatures.component.d.ts +12 -0
- package/{projects/sharedcomponents/src/lib → lib}/components/docsign/component/signatures/style/_layout.scss +0 -0
- package/{projects/sharedcomponents/src/lib → lib}/components/docsign/component/signatures/style/_material-definition.scss +0 -0
- package/{projects/sharedcomponents/src/lib → lib}/components/docsign/component/signatures/style/_theme.scss +0 -0
- package/{projects/sharedcomponents/src/lib → lib}/components/docsign/component/signatures/style/material.scss +0 -0
- package/lib/components/docsign/docsign.component.d.ts +92 -0
- package/lib/components/docsign/docsign.module.d.ts +2 -0
- package/{projects/sharedcomponents/src/lib → lib}/components/docsign/style/_layout.scss +0 -0
- package/{projects/sharedcomponents/src/lib → lib}/components/docsign/style/_material-definition.scss +0 -0
- package/{projects/sharedcomponents/src/lib → lib}/components/docsign/style/_theme.scss +0 -0
- package/{projects/sharedcomponents/src/lib → lib}/components/docsign/style/material.scss +0 -0
- package/lib/components/stock/stock-information/stock-information.component.d.ts +10 -0
- package/lib/components/stock/stock-information-grid/stock-information-grid.component.d.ts +43 -0
- package/lib/components/stock/stock-location/stock-location.component.d.ts +12 -0
- package/lib/components/stock/stock-transfer/co-drop-down-list-fields.interface.d.ts +4 -0
- package/lib/components/stock/stock-transfer/stock-transfer.component.d.ts +19 -0
- package/lib/components/stock/stock.component.d.ts +20 -0
- package/lib/components/stock/stock.module.d.ts +2 -0
- package/lib/components/stock/style/_layout.scss +206 -0
- package/lib/components/stock/style/_material-definition.scss +20 -0
- package/{projects/sharedcomponents/src/lib → lib}/components/stock/style/_theme.scss +0 -0
- package/{projects/sharedcomponents/src/lib → lib}/components/stock/style/material.scss +0 -0
- package/lib/factory/business-object-factory.d.ts +23 -0
- package/lib/factory/decorators/boolean.decorator.d.ts +43 -0
- package/lib/factory/decorators/complex-array.decorator.d.ts +25 -0
- package/lib/factory/decorators/complex-field.decorator.d.ts +25 -0
- package/lib/factory/decorators/date-field.decorator.d.ts +17 -0
- package/lib/factory/decorators/string-number.decorator.d.ts +22 -0
- package/lib/model/business-object.d.ts +7 -0
- package/lib/service/ione-connector-adapter.service.d.ts +17 -0
- package/lib/service/stock.service.d.ts +11 -0
- package/{projects/sharedcomponents/src/lib → lib}/style/_mixin.scss +0 -0
- package/{projects/sharedcomponents/src/lib → lib}/style/_variables.scss +0 -0
- package/lib/utils/array-utils.d.ts +57 -0
- package/lib/utils/is-nill.function.d.ts +1 -0
- package/package.json +25 -66
- package/{projects/sharedcomponents/src/public-api.ts → public-api.d.ts} +2 -4
- package/.browserslistrc +0 -16
- package/.editorconfig +0 -16
- package/.vscode/extensions.json +0 -4
- package/.vscode/launch.json +0 -20
- package/.vscode/tasks.json +0 -42
- package/Sharedcomponents.iml +0 -11
- package/angular.json +0 -133
- package/colijnit-sharedcomponents-1.0.2.tgz +0 -0
- package/karma.conf.js +0 -44
- package/move-assets.js +0 -14
- package/projects/sharedcomponents/.browserslistrc +0 -16
- package/projects/sharedcomponents/README.md +0 -24
- package/projects/sharedcomponents/karma.conf.js +0 -44
- package/projects/sharedcomponents/ng-package.json +0 -17
- package/projects/sharedcomponents/package.json +0 -15
- package/projects/sharedcomponents/src/lib/components/docsign/component/signature/signature.component.ts +0 -82
- package/projects/sharedcomponents/src/lib/components/docsign/component/signatures/signatures.component.ts +0 -50
- package/projects/sharedcomponents/src/lib/components/docsign/docsign.component.ts +0 -252
- package/projects/sharedcomponents/src/lib/components/docsign/docsign.module.ts +0 -22
- package/projects/sharedcomponents/src/lib/components/stock/stock-information/stock-information.component.ts +0 -56
- package/projects/sharedcomponents/src/lib/components/stock/stock-information-grid/stock-information-grid.component.ts +0 -279
- package/projects/sharedcomponents/src/lib/components/stock/stock-location/stock-location.component.ts +0 -82
- package/projects/sharedcomponents/src/lib/components/stock/stock-location/style/_layout.scss +0 -11
- package/projects/sharedcomponents/src/lib/components/stock/stock-location/style/_material-definition.scss +0 -1
- package/projects/sharedcomponents/src/lib/components/stock/stock-location/style/_theme.scss +0 -18
- package/projects/sharedcomponents/src/lib/components/stock/stock-location/style/material.scss +0 -4
- package/projects/sharedcomponents/src/lib/components/stock/stock-transfer/stock-transfer.component.ts +0 -52
- package/projects/sharedcomponents/src/lib/components/stock/stock-transfer/style/_layout.scss +0 -18
- package/projects/sharedcomponents/src/lib/components/stock/stock-transfer/style/_material-definition.scss +0 -1
- package/projects/sharedcomponents/src/lib/components/stock/stock-transfer/style/_theme.scss +0 -6
- package/projects/sharedcomponents/src/lib/components/stock/stock-transfer/style/material.scss +0 -4
- package/projects/sharedcomponents/src/lib/components/stock/stock.component.ts +0 -56
- package/projects/sharedcomponents/src/lib/components/stock/stock.module.ts +0 -45
- package/projects/sharedcomponents/src/lib/components/stock/style/_layout.scss +0 -146
- package/projects/sharedcomponents/src/lib/components/stock/style/_material-definition.scss +0 -1
- package/projects/sharedcomponents/src/lib/factory/business-object-factory.ts +0 -120
- package/projects/sharedcomponents/src/lib/factory/decorators/boolean.decorator.ts +0 -113
- package/projects/sharedcomponents/src/lib/factory/decorators/complex-array.decorator.ts +0 -61
- package/projects/sharedcomponents/src/lib/factory/decorators/complex-field.decorator.ts +0 -63
- package/projects/sharedcomponents/src/lib/factory/decorators/date-field.decorator.ts +0 -41
- package/projects/sharedcomponents/src/lib/factory/decorators/string-number.decorator.ts +0 -48
- package/projects/sharedcomponents/src/lib/model/business-object.ts +0 -85
- package/projects/sharedcomponents/src/lib/service/ione-connector-adapter.service.ts +0 -49
- package/projects/sharedcomponents/src/lib/service/stock.service.ts +0 -40
- package/projects/sharedcomponents/src/lib/utils/array-utils.ts +0 -202
- package/projects/sharedcomponents/src/lib/utils/is-nill.function.ts +0 -4
- package/projects/sharedcomponents/src/test.ts +0 -27
- package/projects/sharedcomponents/tsconfig.lib.json +0 -18
- package/projects/sharedcomponents/tsconfig.lib.prod.json +0 -10
- package/projects/sharedcomponents/tsconfig.spec.json +0 -17
- package/src/app/app.component.scss +0 -8
- package/src/app/app.component.spec.ts +0 -31
- package/src/app/app.component.ts +0 -75
- package/src/app/app.module.ts +0 -22
- package/src/assets/.gitkeep +0 -0
- package/src/environments/environment.prod.ts +0 -3
- package/src/environments/environment.ts +0 -16
- package/src/favicon.ico +0 -0
- package/src/index.html +0 -13
- package/src/main.ts +0 -12
- package/src/polyfills.ts +0 -53
- package/src/styles.scss +0 -24
- package/src/test.ts +0 -26
- package/tsconfig.app.json +0 -15
- package/tsconfig.json +0 -65
- package/tsconfig.spec.json +0 -18
|
@@ -1,202 +0,0 @@
|
|
|
1
|
-
import {ObjectUtils} from "@colijnit/articleapi/build/utils/object-utils";
|
|
2
|
-
import {NumberUtils} from "@colijnit/articleapi/build/utils/number-utils";
|
|
3
|
-
import {isNill} from "@colijnit/articleapi/build/utils/function/is-nill.function";
|
|
4
|
-
import {notNill} from "@colijnit/articleapi/build/utils/function/not-nill.function";
|
|
5
|
-
|
|
6
|
-
export class ArrayUtils {
|
|
7
|
-
/**
|
|
8
|
-
* Returns whether at least one element in given array could be found by given finder function.
|
|
9
|
-
*
|
|
10
|
-
* @param {T[]} array
|
|
11
|
-
* @param {(element: T) => boolean} finder A finder function that takes an element of the array and returns a boolean that represents
|
|
12
|
-
* the 'found status' for that element; whether it should have been found or not.
|
|
13
|
-
*/
|
|
14
|
-
public static ContainsAnElementFoundBy<T>(array: T[], finder: (element: T) => boolean): boolean {
|
|
15
|
-
if (!array || !finder) {
|
|
16
|
-
return false;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
return notNill(this.Find<T>(array, finder));
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* Cross-browser Array.find() function. Returns the first item in given array for which the foundBy function returns true. Returns
|
|
24
|
-
* undefined when none was found.
|
|
25
|
-
*
|
|
26
|
-
* Example usage:
|
|
27
|
-
* const foundItem: BusinessObject = ArrayUtils.Find<BusinessObject>(modelArray, (modelItem: BusinessObject) => <br>
|
|
28
|
-
* (return modelItem.getId() === '1')
|
|
29
|
-
* * });
|
|
30
|
-
*
|
|
31
|
-
* @param array The array with items to search in.
|
|
32
|
-
* @param foundBy The finder function applied on each items of the array, when that returns true, the item is considered found.
|
|
33
|
-
*/
|
|
34
|
-
public static Find<T>(array: T[], foundBy: (item: T) => boolean): T {
|
|
35
|
-
if (!array || !foundBy) {
|
|
36
|
-
return undefined;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
for (let i: number = 0, len: number = array.length; i < len; i++) {
|
|
40
|
-
const itemCur: T = array[i];
|
|
41
|
-
if (foundBy(itemCur) ) {
|
|
42
|
-
return itemCur;
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
return undefined;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
// @returns empty array when nothing found, otherwise array with found items
|
|
49
|
-
public static FindAll<T>(array: T[], foundBy: (item: T) => boolean): T[] {
|
|
50
|
-
const answer: T[] = [];
|
|
51
|
-
if (!array || !foundBy) {
|
|
52
|
-
return answer;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
for (let i: number = 0, len: number = array.length; i < len; i++) {
|
|
56
|
-
const itemCur: T = array[i];
|
|
57
|
-
if (foundBy(itemCur)) {
|
|
58
|
-
answer.push(itemCur);
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
return answer;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
// returns a simple clone of given array, using array.slice(0)
|
|
65
|
-
public static CloneArray<T>(array: T[]): T[] {
|
|
66
|
-
let answer: T[] = [];
|
|
67
|
-
|
|
68
|
-
if (array) {
|
|
69
|
-
answer = array.slice(0);
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
return answer;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
/**
|
|
76
|
-
* Returns a 'semi deep clone' of given array. Its first-level members are object-shallow-cloned (optionally with a strongly typed constructor),
|
|
77
|
-
* or just as plain object (see param arrayItemsClass).
|
|
78
|
-
* @param array
|
|
79
|
-
* @param arrayItemsClass If provided, the cloned array's first-level items will be strongly typed to / constructed as this class. Otherwise
|
|
80
|
-
* it'll be a plain object.
|
|
81
|
-
* @param deepClone Set to true if array items contain FUNCTIONS that need to be cloned..
|
|
82
|
-
* @returns {Array} semi-deep clone of given array
|
|
83
|
-
*/
|
|
84
|
-
public static CloneArrayAndItsItems<T>(array: T[], arrayItemsClass?: any, deepClone: boolean = false): T[] {
|
|
85
|
-
const cloneArray: T[] = [];
|
|
86
|
-
|
|
87
|
-
if (array) {
|
|
88
|
-
for (let i: number = 0, len: number = array.length; i < len; i++) {
|
|
89
|
-
if (deepClone) {
|
|
90
|
-
cloneArray.push(ObjectUtils.GetDeepClone(array[i]));
|
|
91
|
-
} else {
|
|
92
|
-
cloneArray.push(ObjectUtils.GetShallowClone(array[i], arrayItemsClass));
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
} else {
|
|
96
|
-
return [];
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
return cloneArray;
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
/**
|
|
103
|
-
* Removes element at given index from given array. Doesn't just set it to null like JavaScripts standard 'delete' does, but really
|
|
104
|
-
* removes the element using splice().
|
|
105
|
-
*
|
|
106
|
-
* @param {number} index
|
|
107
|
-
* @param {any[]} array in-out
|
|
108
|
-
* @returns {boolean} True if and only if the element on given index is succesfully removed from given array.
|
|
109
|
-
*/
|
|
110
|
-
public static RemoveElementAtIndex(index: number, array: any[]): boolean {
|
|
111
|
-
if (NumberUtils.IsNaN(index) || index < 0 || !Array.isArray(array) || array.length === 0) {
|
|
112
|
-
return false;
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
if (index in array) {
|
|
116
|
-
array.splice(index, 1);
|
|
117
|
-
return true;
|
|
118
|
-
} else {
|
|
119
|
-
return false;
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
/**
|
|
124
|
-
* Removes given element from given array. Doesn't just set it to null like JavaScripts standard 'delete' does, but really removes the
|
|
125
|
-
* element using splice(). Also works on associative arrays.
|
|
126
|
-
*
|
|
127
|
-
* @param {T} element The element to remove.
|
|
128
|
-
* @param {T[]} array The array to remove the element from.
|
|
129
|
-
* @returns {boolean} True iff given element was truly successfully removed from given array.
|
|
130
|
-
*/
|
|
131
|
-
public static RemoveElement<T>(element: T, array: T[]): boolean {
|
|
132
|
-
if (!Array.isArray(array)) {
|
|
133
|
-
return false;
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
const index: number = array.indexOf(element);
|
|
137
|
-
return ArrayUtils.RemoveElementAtIndex(index, array);
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
// Checks if given array is defined, and is an array, and has length > 0, and, optionally checks that the first element is of type given clazz.
|
|
141
|
-
public static IsArrayWithElements<T>(arrayToCheck: T[], classItemsMustBeInstanceOf?: any): boolean {
|
|
142
|
-
if (isNill(arrayToCheck)) {
|
|
143
|
-
return false;
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
if (Array.isArray(arrayToCheck) && arrayToCheck.length > 0) {
|
|
147
|
-
if (classItemsMustBeInstanceOf) {
|
|
148
|
-
return arrayToCheck[0] instanceof classItemsMustBeInstanceOf;
|
|
149
|
-
} else {
|
|
150
|
-
return true;
|
|
151
|
-
}
|
|
152
|
-
} else {
|
|
153
|
-
return false;
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
// Removes all elements from given array for which given filter function holds true. Returns true if at least one removed, else false.
|
|
158
|
-
public static RemoveElementsByFilter(array: any[], filterFunction: (item: any) => boolean): boolean {
|
|
159
|
-
if (!ArrayUtils.IsArrayWithElements(array) || !filterFunction) {
|
|
160
|
-
return false;
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
let atLeastOneRemoved: boolean = false;
|
|
164
|
-
|
|
165
|
-
const len: number = array.length;
|
|
166
|
-
for (let i: number = len - 1; i >= 0; i--) {
|
|
167
|
-
const item: any = array[i];
|
|
168
|
-
if (filterFunction.call(this, item) === true) {
|
|
169
|
-
array.splice(i, 1);
|
|
170
|
-
atLeastOneRemoved = true;
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
return atLeastOneRemoved;
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
public static MoveElement<T>(element: T, toIndex: number, array: T[]): boolean {
|
|
178
|
-
if (!Array.isArray(array) || isNill(toIndex)) {
|
|
179
|
-
return false;
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
const fromIndex: number = array.indexOf(element);
|
|
183
|
-
const toIndexCorrected: number = NumberUtils.GetNearestNumberWithinBounds(toIndex, 0, array.length - 1);
|
|
184
|
-
if (fromIndex === -1 || array[toIndexCorrected] === element) {
|
|
185
|
-
// element did not exist in given array, or already existed on given toIndex
|
|
186
|
-
return false;
|
|
187
|
-
}
|
|
188
|
-
array.splice(toIndexCorrected, 0, array.splice(fromIndex, 1)[0]);
|
|
189
|
-
return true;
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
// PRE: elements exists in given array. POST: given elementToPlace has a lower index than given afterThisElement. Array is in-out manipulated.
|
|
193
|
-
public static PlaceElementAfterOther(array: any[], elementToPlace: any, afterThisElement: any): void {
|
|
194
|
-
if (array) {
|
|
195
|
-
const afterThisElIdx: number = array.indexOf(afterThisElement);
|
|
196
|
-
const elToPlaceIdx: number = array.indexOf(elementToPlace);
|
|
197
|
-
if (afterThisElIdx >= elToPlaceIdx) {
|
|
198
|
-
ArrayUtils.MoveElement(elementToPlace, afterThisElIdx + 1, array);
|
|
199
|
-
}
|
|
200
|
-
}
|
|
201
|
-
}
|
|
202
|
-
}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
// This file is required by karma.conf.js and loads recursively all the .spec and framework files
|
|
2
|
-
|
|
3
|
-
import 'zone.js';
|
|
4
|
-
import 'zone.js/testing';
|
|
5
|
-
import { getTestBed } from '@angular/core/testing';
|
|
6
|
-
import {
|
|
7
|
-
BrowserDynamicTestingModule,
|
|
8
|
-
platformBrowserDynamicTesting
|
|
9
|
-
} from '@angular/platform-browser-dynamic/testing';
|
|
10
|
-
|
|
11
|
-
declare const require: {
|
|
12
|
-
context(path: string, deep?: boolean, filter?: RegExp): {
|
|
13
|
-
<T>(id: string): T;
|
|
14
|
-
keys(): string[];
|
|
15
|
-
};
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
// First, initialize the Angular testing environment.
|
|
19
|
-
getTestBed().initTestEnvironment(
|
|
20
|
-
BrowserDynamicTestingModule,
|
|
21
|
-
platformBrowserDynamicTesting(),
|
|
22
|
-
);
|
|
23
|
-
|
|
24
|
-
// Then we find all the tests.
|
|
25
|
-
const context = require.context('./', true, /\.spec\.ts$/);
|
|
26
|
-
// And load the modules.
|
|
27
|
-
context.keys().map(context);
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/* To learn more about this file see: https://angular.io/config/tsconfig. */
|
|
2
|
-
{
|
|
3
|
-
"extends": "../../tsconfig.json",
|
|
4
|
-
"compilerOptions": {
|
|
5
|
-
"outDir": "../../out-tsc/lib",
|
|
6
|
-
"declaration": true,
|
|
7
|
-
"declarationMap": true,
|
|
8
|
-
"inlineSources": true,
|
|
9
|
-
"types": []
|
|
10
|
-
},
|
|
11
|
-
"exclude": [
|
|
12
|
-
"src/test.ts",
|
|
13
|
-
"**/*.spec.ts"
|
|
14
|
-
],
|
|
15
|
-
"types": [
|
|
16
|
-
"src/lib/@types"
|
|
17
|
-
]
|
|
18
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/* To learn more about this file see: https://angular.io/config/tsconfig. */
|
|
2
|
-
{
|
|
3
|
-
"extends": "../../tsconfig.json",
|
|
4
|
-
"compilerOptions": {
|
|
5
|
-
"outDir": "../../out-tsc/spec",
|
|
6
|
-
"types": [
|
|
7
|
-
"jasmine"
|
|
8
|
-
]
|
|
9
|
-
},
|
|
10
|
-
"files": [
|
|
11
|
-
"src/test.ts"
|
|
12
|
-
],
|
|
13
|
-
"include": [
|
|
14
|
-
"**/*.spec.ts",
|
|
15
|
-
"**/*.d.ts"
|
|
16
|
-
]
|
|
17
|
-
}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { TestBed } from '@angular/core/testing';
|
|
2
|
-
import { AppComponent } from './app.component';
|
|
3
|
-
|
|
4
|
-
describe('AppComponent', () => {
|
|
5
|
-
beforeEach(async () => {
|
|
6
|
-
await TestBed.configureTestingModule({
|
|
7
|
-
declarations: [
|
|
8
|
-
AppComponent
|
|
9
|
-
],
|
|
10
|
-
}).compileComponents();
|
|
11
|
-
});
|
|
12
|
-
|
|
13
|
-
it('should create the app', () => {
|
|
14
|
-
const fixture = TestBed.createComponent(AppComponent);
|
|
15
|
-
const app = fixture.componentInstance;
|
|
16
|
-
expect(app).toBeTruthy();
|
|
17
|
-
});
|
|
18
|
-
|
|
19
|
-
it(`should have as title 'Sharedcomponents'`, () => {
|
|
20
|
-
const fixture = TestBed.createComponent(AppComponent);
|
|
21
|
-
const app = fixture.componentInstance;
|
|
22
|
-
expect(app.title).toEqual('Sharedcomponents');
|
|
23
|
-
});
|
|
24
|
-
|
|
25
|
-
it('should render title', () => {
|
|
26
|
-
const fixture = TestBed.createComponent(AppComponent);
|
|
27
|
-
fixture.detectChanges();
|
|
28
|
-
const compiled = fixture.nativeElement as HTMLElement;
|
|
29
|
-
expect(compiled.querySelector('.content span')?.textContent).toContain('Sharedcomponents app is running!');
|
|
30
|
-
});
|
|
31
|
-
});
|